chore: chat hooks

This commit is contained in:
jialin
2025-02-19 20:50:32 +08:00
parent 9e0634f449
commit f1ab927a7e
16 changed files with 827 additions and 756 deletions
+48
View File
@@ -0,0 +1,48 @@
import { WarningFilled } from '@ant-design/icons';
import { Typography } from 'antd';
import classNames from 'classnames';
import React from 'react';
import './block.less';
interface AlertInfoProps {
type: 'danger' | 'warning';
message: string;
rows?: number;
icon?: React.ReactNode;
ellipsis?: boolean;
style?: React.CSSProperties;
title: React.ReactNode;
}
const AlertInfo: React.FC<AlertInfoProps> = (props) => {
const { message, type, rows = 1, ellipsis, style, title } = props;
return (
<>
{message ? (
<div
className={classNames('alert-info-block', type)}
style={{ ...style }}
>
<Typography.Paragraph
ellipsis={
ellipsis !== undefined
? ellipsis
: {
rows: rows,
tooltip: message
}
}
>
<div className={classNames('title', type)}>
<WarningFilled className={classNames('info-icon', type)} />
<span className="text">{title}</span>
</div>
{message}
</Typography.Paragraph>
</div>
) : null}
</>
);
};
export default React.memo(AlertInfo);