Files
web-Iot/src/components/Empty.tsx

37 lines
726 B
TypeScript
Raw Normal View History

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