"use client" import { useState } from "react" import { TextEditor } from "../text-editor" interface NoteContentProps { onSubmit?: (content: string) => void onContentChange?: (content: string) => void isSubmitting?: boolean isOpen?: boolean initialContent?: string } export function NoteContent({ onSubmit, onContentChange, isSubmitting, initialContent, }: NoteContentProps) { const [content, setContent] = useState(initialContent ?? "") const [seededContent] = useState(initialContent || undefined) const canSubmit = content.trim().length > 0 && !isSubmitting const handleSubmit = () => { if (canSubmit && onSubmit) { onSubmit(content) } } const handleContentChange = (newContent: string) => { setContent(newContent) onContentChange?.(newContent) } return (
) }