mirror of
https://github.com/temetro/temetro.git
synced 2026-08-09 10:09:39 +00:00
Add Calendar dialog, Prescriptions & Messages pages, note delete confirm
- Appointments: a Calendar button next to Add opens a month-grid dialog (reuses the Calendar primitive + shared ScheduleList); the schedule day is marked and selecting it lists that day's appointments. - Patients sub-nav: new Prescriptions page (mock list + KPIs) with a compact "New prescription" dialog reusing the patient quick-search pattern. - Notes: deleting a note now goes through a reusable ConfirmDialog instead of deleting immediately. - New top-level Messages page: two-pane email-style inbox (list + reading pane with mock reply composer), mirroring the Notes layout. - Sidebar logo bumped from size-9 to size-10. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
import { type ReactNode, useReducer, useState } from "react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ConfirmDialog } from "@/components/ui/confirm-dialog";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import {
|
||||
Toolbar,
|
||||
@@ -77,6 +78,7 @@ export function NotesEditor({
|
||||
onDelete?: () => void;
|
||||
}) {
|
||||
const [title, setTitle] = useState(note.title);
|
||||
const [confirmOpen, setConfirmOpen] = useState(false);
|
||||
// Force a re-render on every editor transaction so the toolbar reflects the
|
||||
// current formatting/undo state.
|
||||
const [, bump] = useReducer((n: number) => n + 1, 0);
|
||||
@@ -119,7 +121,7 @@ export function NotesEditor({
|
||||
{onDelete && (
|
||||
<Button
|
||||
aria-label="Delete note"
|
||||
onClick={onDelete}
|
||||
onClick={() => setConfirmOpen(true)}
|
||||
size="icon"
|
||||
type="button"
|
||||
variant="ghost"
|
||||
@@ -217,6 +219,17 @@ export function NotesEditor({
|
||||
<div className="min-h-0 flex-1 cursor-text overflow-y-auto rounded-2xl border bg-card/30">
|
||||
<EditorContent className="h-full" editor={editor} />
|
||||
</div>
|
||||
|
||||
{onDelete && (
|
||||
<ConfirmDialog
|
||||
confirmLabel="Delete note"
|
||||
description={`"${title.trim() || "Untitled note"}" will be permanently deleted. This can't be undone.`}
|
||||
onConfirm={onDelete}
|
||||
onOpenChange={setConfirmOpen}
|
||||
open={confirmOpen}
|
||||
title="Delete this note?"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user