/** * New Concept Scheme Guide * - Prompts adding title and description to new concept scheme. * - Data must be saved to newly created Concept Scheme documents before * add top concept / add concept buttons will work. * @todo: Consider adding more instructions, a .gif, or video to this guide. */ import {useCallback, useState} from 'react' import {Card, Label, Stack, Text, Button, Dialog, Box, TextArea, TextInput} from '@sanity/ui' import {AddIcon} from '@sanity/icons' import {useAddTitle} from '../../hooks' import {InlineHelp} from '../../styles' import {SanityDocument} from 'sanity' export const NewScheme = ({document}: {document: SanityDocument}) => { const [open, setOpen] = useState(false) const [titleValue, setTitleValue] = useState('') const [descriptionValue, setDescriptionValue] = useState('') const onClose = useCallback(() => setOpen(false), []) const onOpen = useCallback(() => setOpen(true), []) const handleTitleChange = useCallback((event: any) => { setTitleValue(event.currentTarget.value) }, []) const handleDescriptionChange = useCallback((event: any) => { setDescriptionValue(event.currentTarget.value) }, []) const addTitle = useAddTitle() const handleAddTitle = useCallback(() => { addTitle(document, titleValue, descriptionValue) }, [addTitle, descriptionValue, document, titleValue]) return ( To start using hierarchy view taxonomy builder, first give your concept scheme a name and optional description. You can also use the "Editor" tab to add concepts to the tree manually.