mirror of
https://github.com/temetro/temetro.git
synced 2026-08-10 18:49:29 +00:00
0f10aafa43
- 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>
64 lines
1.6 KiB
TypeScript
64 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import type { ReactNode } from "react";
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
import {
|
|
Dialog,
|
|
DialogClose,
|
|
DialogDescription,
|
|
DialogFooter,
|
|
DialogHeader,
|
|
DialogPopup,
|
|
DialogTitle,
|
|
} from "@/components/ui/dialog";
|
|
|
|
// A small controlled confirmation dialog built on Dialog (there is no AlertDialog
|
|
// primitive). Use for destructive actions: the confirm button is `destructive`
|
|
// by default. onConfirm fires, then the dialog closes.
|
|
export function ConfirmDialog({
|
|
open,
|
|
onOpenChange,
|
|
onConfirm,
|
|
title,
|
|
description,
|
|
confirmLabel = "Delete",
|
|
cancelLabel = "Cancel",
|
|
variant = "destructive",
|
|
}: {
|
|
open: boolean;
|
|
onOpenChange: (open: boolean) => void;
|
|
onConfirm: () => void;
|
|
title: string;
|
|
description?: ReactNode;
|
|
confirmLabel?: string;
|
|
cancelLabel?: string;
|
|
variant?: "destructive" | "default";
|
|
}) {
|
|
return (
|
|
<Dialog onOpenChange={onOpenChange} open={open}>
|
|
<DialogPopup className="sm:max-w-sm">
|
|
<DialogHeader>
|
|
<DialogTitle>{title}</DialogTitle>
|
|
{description && <DialogDescription>{description}</DialogDescription>}
|
|
</DialogHeader>
|
|
<DialogFooter variant="bare">
|
|
<DialogClose render={<Button type="button" variant="outline" />}>
|
|
{cancelLabel}
|
|
</DialogClose>
|
|
<Button
|
|
onClick={() => {
|
|
onConfirm();
|
|
onOpenChange(false);
|
|
}}
|
|
type="button"
|
|
variant={variant}
|
|
>
|
|
{confirmLabel}
|
|
</Button>
|
|
</DialogFooter>
|
|
</DialogPopup>
|
|
</Dialog>
|
|
);
|
|
}
|