This commit is contained in:
mmc
2026-04-28 16:36:22 +08:00
parent b540f842ab
commit efed5441b3
3 changed files with 190 additions and 124 deletions

38
src/components/Empty.tsx Normal file
View File

@@ -0,0 +1,38 @@
import React from 'react';
import { Empty } from 'antd';
import { FileTextOutlined } from '@ant-design/icons';
interface EmptyDataProps {
/** 自定义文案 */
description?: string;
/** 组件高度 */
height?: number | string;
/** 图标大小 */
iconSize?: number;
}
const EmptyData: React.FC<EmptyDataProps> = ({
description = '暂无数据',
height = 220,
iconSize = 56
}) => {
return (
<div
style={{
width: '100%',
height,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
background: 'transparent'
}}
>
<Empty
image={<FileTextOutlined style={{ fontSize: iconSize, color: '#c5c8ce' }} />}
description={<span style={{ color: '#999', fontSize: 16 }}>{description}</span>}
/>
</div>
);
};
export default EmptyData;