import { useCallback, useState } from 'react' import { Highlight } from '../../lib/networking/fragments/highlightFragment' import { updateHighlightMutation } from '../../lib/networking/mutations/updateHighlightMutation' import { showErrorToast, showSuccessToast } from '../../lib/toastHelpers' import { Button } from './Button' import { HStack, VStack } from './LayoutPrimitives' import { StyledTextArea } from './StyledTextArea' type HighlightNoteTextEditAreaProps = { setIsEditing: (editing: boolean) => void highlight: Highlight updateHighlight: (highlight: Highlight) => void } export const HighlightNoteTextEditArea = ( props: HighlightNoteTextEditAreaProps ): JSX.Element => { const [noteContent, setNoteContent] = useState( props.highlight.annotation ?? '' ) const handleNoteContentChange = useCallback( (event: React.ChangeEvent): void => { setNoteContent(event.target.value) }, [setNoteContent] ) return ( ) }