style: show voice error message

This commit is contained in:
jialin
2024-11-29 20:02:54 +08:00
parent 2ddeca8f9d
commit e622636686
15 changed files with 278 additions and 103 deletions
+13 -6
View File
@@ -7,10 +7,12 @@ interface AlertInfoProps {
message: string;
rows?: number;
icon?: React.ReactNode;
ellipsis?: boolean;
style?: React.CSSProperties;
}
const AlertInfo: React.FC<AlertInfoProps> = (props) => {
const { message, type, rows = 1 } = props;
const { message, type, rows = 1, ellipsis, style } = props;
if (!message) {
return null;
}
@@ -18,16 +20,21 @@ const AlertInfo: React.FC<AlertInfoProps> = (props) => {
return (
<Typography.Paragraph
type={type}
ellipsis={{
rows: rows,
tooltip: message
}}
ellipsis={
ellipsis !== undefined
? ellipsis
: {
rows: rows,
tooltip: message
}
}
style={{
textAlign: 'center',
padding: '2px 5px',
borderRadius: 'var(--border-radius-base)',
margin: 0,
backgroundColor: 'var(--ant-color-error-bg)'
backgroundColor: 'var(--ant-color-error-bg)',
...style
}}
>
<WarningOutlined className="m-r-8" />