// @ts-ignore
import React, { useEffect, useState } from 'react';
import TreeCustom from '../index';
import { HomeOutlined } from '@ant-design/icons';

const Demo = (props) => {
  const treeData = [
    {
      title: '熊猫智慧水务',
      key: '0-0',
      children: [
        {
          title: '平台研发部',
          key: '0-0-0',
          children: [
            {
              title: '研发一部',
              key: '0-0-0-0',
            },
            {
              title: '研发二部',
              key: '0-0-0-1',
            },
            {
              title: '研发三部',
              key: '0-0-0-2',
            },
            {
              title: '研发四部',
              key: '0-0-0-3',
            },
          ],
        },
        {
          title: '项目实施部',
          key: '0-0-1',
          children: [],
        },
        {
          title: '售前支持部',
          key: '0-0-2',
          children: [],
        },
        {
          title: '熊猫智慧水务运营部',
          key: '0-0-3',
          children: [],
        },
        {
          title: '智慧水务办公室',
          key: '0-0-4',
          children: [],
        },
      ],
    },
  ];
  const onSelect = (selectedKeys, info) => {
    console.log('selected', selectedKeys, info);
  };
  const onCheck = (checkedKeys, info) => {
    console.log('onCheck', checkedKeys, info);
  };
  return (
    <TreeCustom
      defaultSelectedKeys={['0-0-0']}
      defaultExpandedKeys={['0-0-0']}
      onSelect={onSelect}
      onCheck={onCheck}
      treeData={treeData}
    />
  );
};

export default Demo;
