"use client"; import { NotesEditor } from "@/components/notes/notes-editor"; import { Sheet, SheetHeader, SheetPopup, SheetTitle, } from "@/components/ui/sheet"; import type { Note } from "@/lib/notes"; // Right-side Sheet that holds the rich-text NotesEditor, opened from the Notes // list (mirrors the Patients table → side Sheet pattern). The save/delete logic // stays in NotesView and is passed down. `editorKey` remounts the editor when a // different note (or a fresh draft) is opened. export function NoteDetailSheet({ note, editorKey, open, onOpenChange, saving, onSave, onDelete, }: { note: Note | null; editorKey: string; open: boolean; onOpenChange: (open: boolean) => void; saving: boolean; onSave: (data: { title: string; content: string }) => void; onDelete?: () => void; }) { return ( {note?.id ? "Edit note" : "New note"} {/* Plain flex container (not SheetPanel) so the editor gets a bounded height and scrolls internally rather than nesting two scroll areas. */}
{note && ( )}
); }