diff --git a/apps/web/components/add-document/note.tsx b/apps/web/components/add-document/note.tsx index ef462df4..98952449 100644 --- a/apps/web/components/add-document/note.tsx +++ b/apps/web/components/add-document/note.tsx @@ -5,7 +5,7 @@ import { LinkIcon } from "lucide-react" import { cn } from "@lib/utils" import { Button } from "@ui/components/button" import { dmSansClassName } from "@/lib/fonts" -import { TextEditor } from "../text-editor" +import { resolveSubmittedContent, TextEditor } from "../text-editor" import { extractUrls } from "@/lib/url-helpers" interface NoteContentProps { @@ -31,11 +31,10 @@ export function NoteContent({ const { urls: detectedUrls } = useMemo(() => extractUrls(content), [content]) const showBulkOffer = detectedUrls.length >= 2 && !dismissed - const canSubmit = content.trim().length > 0 && !isSubmitting - - const handleSubmit = () => { - if (canSubmit && onSubmit) { - onSubmit(content) + const handleSubmit = (submittedContent?: string) => { + const contentToSubmit = resolveSubmittedContent(submittedContent, content) + if (contentToSubmit.trim() && !isSubmitting && onSubmit) { + onSubmit(contentToSubmit) } } diff --git a/apps/web/components/document-modal/content/text-editor-content.tsx b/apps/web/components/document-modal/content/text-editor-content.tsx index 1e4c1d05..b5f51813 100644 --- a/apps/web/components/document-modal/content/text-editor-content.tsx +++ b/apps/web/components/document-modal/content/text-editor-content.tsx @@ -14,7 +14,7 @@ export interface TextEditorProps { hasUnsavedChanges: boolean isSaving: boolean onContentChange: (content: string) => void - onSave: () => void + onSave: (content?: string) => void onReset: () => void } @@ -60,7 +60,7 @@ export function TextEditorContent({