import { ModalRoot, ModalContent, ModalOverlay, } from './../../elements/ModalPrimitives' import { Box, HStack } from '../../elements/LayoutPrimitives' import { Button } from '../../elements/Button' import { StyledText } from '../../elements/StyledText' import { Highlight } from '../../../lib/networking/fragments/highlightFragment' import { HighlightView } from '../../patterns/HighlightView' import { useCallback, useState } from 'react' import { StyledTextArea } from '../../elements/StyledTextArea' type HighlightPostToFeedModalProps = { highlight: Highlight author: string title: string onCommit: (highlight: Highlight, comment: string) => void onOpenChange: (open: boolean) => void } export function HighlightPostToFeedModal( props: HighlightPostToFeedModalProps ): JSX.Element { const [comment, setComment] = useState('') const handleCommentChange = useCallback( (event: React.ChangeEvent): void => { setComment(event.target.value) }, [setComment] ) const postHighlight = useCallback(async () => { props.onCommit(props.highlight, comment) props.onOpenChange(false) }, [comment, props]) return ( { event.preventDefault() }} css={{ overflow: 'auto' }} > Post Highlight ) }