Files
behavior3editor/fs-tree-view/components/icon.tsx
T
2020-11-19 18:18:45 +08:00

35 lines
717 B
TypeScript

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
};