Files
web-Iot/src/components/Empty.tsx
2026-04-28 16:36:22 +08:00

39 lines
797 B
TypeScript

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;