import { TreeSelect, Row, Col } from '@btri-ui/base';
import React, { useState } from 'react';

const { TreeNode } = TreeSelect;

const App: React.FC = () => {
  const [value, setValue] = useState<string>();

  const onChange = (newValue: string) => {
    console.log(newValue);
    setValue(newValue);
  };

  return (
    <Row autoMode>
      <Col span={4}>
        <TreeSelect multiple onChange={onChange} treeCheckable={true}>
          <TreeNode value="parent 1" title="parent 1">
            <TreeNode value="parent 1-0" title="parent 1-0">
              <TreeNode value="leaf1" title="my leaf" />
              <TreeNode value="leaf2" title="your leaf" />
            </TreeNode>
            <TreeNode value="parent 1-1" title="parent 1-1">
              <TreeNode value="sss" title={'ssss'} />
            </TreeNode>
          </TreeNode>
        </TreeSelect>
      </Col>
    </Row>
  );
};

export default App;
