import { Tree } from '@btri-ui/base';
import React from 'react';
const treeData = [
  {
    title: '第一层1',
    key: '1',
    children: [
      {
        title: '第二层1',
        key: '1-1',
        children: [
          {
            title: '第三层1',
            key: '1-1-1',
          },
          {
            title: '第三层2',
            key: '1-1-2',
          },
        ],
      },
      {
        title: '第二层2',
        key: '1-2',
        children: [
          {
            title: '第三层1',
            key: '1-2-1',
          },
          {
            title: '第三层2',
            key: '1-2-2',
          },
        ],
      },
    ],
  },
  {
    title: '第一层2',
    key: '2',
    children: [
      {
        title: '第二层1',
        key: '2-1',
        children: [
          {
            title: '第三层1',
            key: '2-1-1',
          },
          {
            title: '第三层2',
            key: '2-1-2',
          },
        ],
      },
      {
        title: '第二层',
        key: '2-2',
        children: [
          {
            title: '第三层1',
            key: '2-2-1',
          },
          {
            title: '第三层2',
            key: '2-2-2',
          },
        ],
      },
    ],
  },
];

const App = () => {
  const onSelect = (selectedKeys, info) => {
    console.log('selected', selectedKeys, info);
  };

  const onCheck = (checkedKeys, info) => {
    console.log('onCheck', checkedKeys, info);
  };

  return (
    <Tree showLine onSelect={onSelect} onCheck={onCheck} treeData={treeData} />
  );
};

export default App;
