Files
Khalid Abdi ab2f10bffc i18n: convert settings, chat, patient records and notes; update docs
Finish the i18n pass: settings panels (profile/care-team/signing), the
chat heading + input, the patient cards / detail / create-edit form, and
the notes page + rich-text editor are all keyed in en/translation.json.
All 526 static t() keys resolve. Document the new backend resources +
Socket.io realtime (backend README/CLAUDE) and the i18n coverage
(frontend CLAUDE).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 02:23:20 +03:00

61 lines
1.7 KiB
TypeScript

"use client";
import { useTranslation } from "react-i18next";
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;
}) {
const { t } = useTranslation();
return (
<Sheet onOpenChange={onOpenChange} open={open}>
<SheetPopup className="sm:max-w-2xl" side="right">
<SheetHeader>
<SheetTitle>
{note?.id ? t("notes.editNote") : t("notes.new")}
</SheetTitle>
</SheetHeader>
{/* Plain flex container (not SheetPanel) so the editor gets a bounded
height and scrolls internally rather than nesting two scroll areas. */}
<div className="flex min-h-0 flex-1 flex-col px-6 pt-1 pb-6">
{note && (
<NotesEditor
key={editorKey}
note={note}
onDelete={onDelete}
onSave={onSave}
saving={saving}
/>
)}
</div>
</SheetPopup>
</Sheet>
);
}