Files
web-Iot/src/components/Empty.tsx
2026-08-12 11:29:44 +08:00

37 lines
726 B
TypeScript

import React from 'react';
import { Empty } from 'antd';
import { useTranslation } from 'react-i18next';
import { t } from 'i18next';
interface EmptyDataProps {
/** 自定义文案 */
description?: string;
/** 组件高度 */
height?: number | string;
}
const EmptyData: React.FC<EmptyDataProps> = ({
description = t('common.noData'),
height = 220
}) => {
return (
<div
style={{
width: '100%',
height,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
background: 'transparent'
}}
>
<Empty
image={Empty.PRESENTED_IMAGE_SIMPLE}
description={<span style={{ color: '#999', fontSize: 14 }}>{description}</span>}
/>
</div>
);
};
export default EmptyData;