import React from "react";
import { TreeView as BaseTreeView } from "baseui/tree-view";

export interface TreeViewProps {
  data: any[];
  indentGuides?: boolean;
  onToggle?: (e: any) => void;
}

/**
 * This is the `<TreeView>` component <br />
 * Use this to show a tree of data to the user
 */
const TreeView: React.FC<TreeViewProps> = (props) => {
  const { data, onToggle } = props;
  return (
    <BaseTreeView {...props} data={data} indentGuides onToggle={onToggle} />
  );
};

export default TreeView;
