import { useState } from 'react' type CommentFormProps = { handleSubmit: (content: string) => Promise } export const CommentForm = ({ handleSubmit }: CommentFormProps) => { const [isSubmitting, setIsSubmitting] = useState(false) const [commentText, setCommentText] = useState('') const handleComment = async () => { setIsSubmitting(true) const submitted = await handleSubmit(commentText) if (submitted) setCommentText('') setIsSubmitting(false) } return (