前端: 添加空状态组件
This commit is contained in:
parent
52bd9bb1c2
commit
9d1c28e9a7
21
frontend/src/renderer/components/Empty.jsx
Normal file
21
frontend/src/renderer/components/Empty.jsx
Normal file
@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
import { Empty as AntEmpty } from 'antd';
|
||||
import { FolderOpenOutlined } from '@ant-design/icons';
|
||||
|
||||
function Empty({ type = 'file', onAction }) {
|
||||
const descriptions = {
|
||||
file: '暂无文件,上传一个文件开始使用',
|
||||
folder: '文件夹为空',
|
||||
search: '没有找到匹配的文件',
|
||||
trash: '回收站是空的'
|
||||
};
|
||||
|
||||
return (
|
||||
<AntEmpty
|
||||
image={<FolderOpenOutlined style={{ fontSize: 64, color: '#d9d9d9' }} />}
|
||||
description={descriptions[type] || '暂无数据'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default Empty;
|
||||
Loading…
Reference in New Issue
Block a user