feat: fs tree component

This commit is contained in:
duanhongbo committed 2020-11-19 18:18:45 +08:00
1 parent 6c57df23f2
commit 278255efd7
18 files changed
+2427 -94

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import React from "react";
import PropTypes from "prop-types";
import { FolderOutlined,FolderOpenOutlined,FileTextOutlined,SearchOutlined,CloseOutlined,LoadingOutlined} from '@ant-design/icons';
import { Node,NodeDict } from "./Tree/TreeNode";
const FileIcon = (node:Node) => {
if (node.type === "file") {
return (
<FileTextOutlined />
);
}
return node.isOpen ?(<FolderOpenOutlined />):(<FolderOutlined />)
};
const SearchIcon = () => {
return <SearchOutlined />;
};
const CloseIcon = () => {
return <CloseOutlined />;
};
const LoadingIcon = ()=>{
return <LoadingOutlined />
}
export default {
file: FileIcon,
search: SearchIcon,
close: CloseIcon,
loading: LoadingIcon
};