style: show voice error message
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user