feat: fs tree component
This commit is contained in:
1 parent
6c57df23f2
commit
278255efd7
18 files changed
+2427
-94
No files matched your search
@@ -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
|
||||
};
|
||||
Reference in new issue
Block a user