diff --git a/components/carnet/editor.tsx b/components/carnet/editor.tsx index 147c89b..75007fd 100644 --- a/components/carnet/editor.tsx +++ b/components/carnet/editor.tsx @@ -5,6 +5,7 @@ import { Image, FileText, Link, List, Plus } from 'lucide-react'; import { useRouter } from 'next/navigation'; import { useSession } from 'next-auth/react'; import { noteContentCache } from '@/lib/cache-utils'; +import { HealthForm } from './health-form'; interface Note { id: string; @@ -118,6 +119,12 @@ export const Editor: React.FC = ({ note, onSave, currentFolder = 'N debouncedSave(); }; + // Handle content change from HealthForm (direct string update) + const handleHealthContentChange = (newContent: string) => { + setContent(newContent); + debouncedSave(); + }; + const debouncedSave = () => { if (saveTimeout.current) { clearTimeout(saveTimeout.current); @@ -264,18 +271,28 @@ export const Editor: React.FC = ({ note, onSave, currentFolder = 'N )} {/* Editor Area */} -
+
{isLoading ? (
- ) : ( -