import {Box, Container, Stack, Text} from '@sanity/ui' import {usePerspective} from 'sanity' import {ReleaseContext, SchemeContext} from '../context' import type {ConceptSchemeDocument, TreeViewProps} from '../types' import {Hierarchy} from './Hierarchy' import {InputHierarchy} from './inputs' /** * #### Tree View Component Wrapper * This is the view component for the hierarchy tree. It is the * top level of concept scheme views and is passed into Desk * structure to render the primary view for taxonomy documents. * @param document - The document to render. * @param branchId - The branch ID to fetch concepts from. * @param inputComponent - Specifies whether the component is Studio input component, which will hide tree view controls and chrome. * @param selectConcept - The function to call when a concept is selected. */ export const TreeView = ({ document, branchId, inputComponent = false, selectConcept, expanded, conceptRecs, recsError, }: TreeViewProps) => { const {selectedPerspectiveName} = usePerspective() return ( {inputComponent ? ( ) : ( {document?.displayed?.description && ( Description {document?.displayed.description} )} )} ) } export default TreeView