import { useNavigate } from "react-router-dom"; import { AppShell, Notice } from "../components/AppShell"; import { Icon, type IconName } from "../components/Icon"; import { ru } from "../content/ru"; import { useDialog } from "../dialog/DialogContext"; import { humanDate, useToday } from "./useToday"; // F1 / F2 · Врач: следующий визит и связь с врачом (действия выполняет движок диалога) export function Doctor() { const t = ru.doctor; const navigate = useNavigate(); const dialog = useDialog(); const { plan } = useToday(); const go = (button: string, label: string) => void dialog.send({ type: "button", button }, label).then((ok) => ok && navigate("/flow")); const actions: { button: string; label: string; icon: IconName }[] = [ { button: "menu:contact_doctor", label: t.write, icon: "message" }, { button: "menu:visit", label: t.earlier, icon: "calendar" }, { button: "safety_plan", label: t.plan, icon: "shield" }, ]; return (

{t.title}

{plan && !plan.has_doctor ? ( {t.noDoctor} ) : (
{t.visit} {plan?.next_visit ? humanDate(plan.next_visit) : t.visitNone}
{t.attending}
{actions.map((a) => ( ))}
{t.writeNote}
)}
); }