import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom";
import { Tree, Input, Dropdown, Menu } from "antd";
import "./MemberTree.less";

const { Search } = Input;
const { DirectoryTree } = Tree;

function MemberTree(props) {
  const {treeType} = props
  const treeData = [
    {
      title: "小麦助教",
      key: "0-0",
      children: [
        {
          title: "技术部",
          key: "0-0-0",
          children: [
            {
              title: "leaf",
              key: "0-0-0-0",
            },
            {
              title: "leaf",
              key: "0-0-0-1",
            },
          ],
        },
        {
          title: "商务部",
          key: "0-0-1",
          children: [
            {
              title:'aaa',
              key: "0-0-1-0",
            },
          ],
        },
      ],
    },
  ];


  return (
    <div className="member-tree">
      <div className="tree-con">
        <DirectoryTree
          defaultExpandAll
          checkable
          showIcon={false}
          treeData={treeData}
          titleRender={(nodeData) => {
            return (
              <div
                className="node-title-con"
              >
                {/* <span className="icon iconfont title-icon">&#xe604;</span> */}
                <span className="icon iconfont title-icon">&#xe603;</span>
                <span>{nodeData.title}</span>
              </div>
            );
          }}
        />
      </div>
    </div>
  );
}

export default withRouter(MemberTree);
