mirror of
https://github.com/csunny/DB-GPT.git
synced 2026-01-15 14:56:03 +00:00
32 lines
740 B
TypeScript
32 lines
740 B
TypeScript
import { Button, Empty } from 'antd';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
interface Props {
|
|
error?: boolean;
|
|
description?: string;
|
|
refresh?: () => void;
|
|
}
|
|
|
|
function MyEmpty({ error, description, refresh }: Props) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Empty
|
|
image="/empty.png"
|
|
imageStyle={{ width: 320, height: 320, margin: '0 auto', maxWidth: '100%', maxHeight: '100%' }}
|
|
className="flex items-center justify-center flex-col h-full w-full"
|
|
description={
|
|
error ? (
|
|
<Button type="primary" onClick={refresh}>
|
|
{t('try_again')}
|
|
</Button>
|
|
) : (
|
|
description ?? t('no_data')
|
|
)
|
|
}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default MyEmpty;
|