mirror of
https://github.com/temetro/temetro.git
synced 2026-08-10 18:49:29 +00:00
321a6298a4
- Pharmacy: the sidebar entry now expands into Pharmacy + a new Inventory page (searchable medication stock with derived in-stock/low/out availability, backed by /api/inventory). Fix the dispensing-queue "Expiring" badge so it only flags courses ending within the next 7 days, not ones already elapsed. - Lab "Add analysis result": the patient picker no longer lists patients until you type and supports arrow-key + Enter selection; the test field offers a catalog of common analyses with an Advanced option (custom analysis + ref range); submitted results now show immediately in a Recent results feed. - Analysis: add a Live panel (real-time line chart) and replace the flat trend sparklines with bklit-ui area + bar charts (installed from the @bklit shadcn registry; chart CSS variables wired into the theme for light and dark). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
133 lines
3.1 KiB
TypeScript
133 lines
3.1 KiB
TypeScript
import {
|
|
BarChart3,
|
|
Boxes,
|
|
CalendarClock,
|
|
Cross,
|
|
FlaskConical,
|
|
History,
|
|
ListTodo,
|
|
type LucideIcon,
|
|
Mail,
|
|
NotebookPen,
|
|
Pill,
|
|
Plus,
|
|
Settings,
|
|
Users,
|
|
} from "lucide-react";
|
|
|
|
// Access areas gate routes/nav by role capability (probed against the Better
|
|
// Auth permissions in lib/access.ts — see canAccessArea in lib/roles.ts):
|
|
// - "clinical": full clinicians only (owner/admin/doctor/member).
|
|
// - "pharmacy": pharmacy + full clinicians.
|
|
// - "lab": lab + full clinicians.
|
|
// Defined here (not roles.ts) because roles.ts imports nav.ts.
|
|
export type AccessArea = "clinical" | "pharmacy" | "lab";
|
|
|
|
export type NavSubItem = {
|
|
id: string;
|
|
// i18n key resolved with t() at render time.
|
|
labelKey: string;
|
|
icon?: LucideIcon;
|
|
link: string;
|
|
// Hidden from roles outside this access area. See lib/roles.ts.
|
|
access?: AccessArea;
|
|
};
|
|
|
|
export type NavItem = {
|
|
id: string;
|
|
// i18n key resolved with t() at render time.
|
|
labelKey: string;
|
|
icon: LucideIcon;
|
|
link: string;
|
|
// Optional sub-pages revealed under this item in the sidebar.
|
|
subs?: NavSubItem[];
|
|
// Hidden from roles outside this access area. See lib/roles.ts.
|
|
access?: AccessArea;
|
|
};
|
|
|
|
// Single source of truth for the primary navigation. Consumed by the sidebar
|
|
// (components/sidebar-02/app-sidebar.tsx) and the command palette
|
|
// (components/command-palette.tsx) so the two never drift.
|
|
export const navItems: NavItem[] = [
|
|
{
|
|
id: "new-chat",
|
|
labelKey: "nav.newChat",
|
|
icon: Plus,
|
|
link: "/",
|
|
access: "clinical",
|
|
},
|
|
{
|
|
id: "patients",
|
|
labelKey: "nav.patients",
|
|
icon: Users,
|
|
link: "/patients",
|
|
subs: [
|
|
{ id: "patients-list", labelKey: "nav.patients", link: "/patients" },
|
|
{
|
|
id: "appointments",
|
|
labelKey: "nav.appointments",
|
|
icon: CalendarClock,
|
|
link: "/appointments",
|
|
},
|
|
{
|
|
id: "prescriptions",
|
|
labelKey: "nav.prescriptions",
|
|
icon: Pill,
|
|
link: "/prescriptions",
|
|
access: "clinical",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
id: "analysis",
|
|
labelKey: "nav.analysis",
|
|
icon: BarChart3,
|
|
link: "/analysis",
|
|
access: "clinical",
|
|
},
|
|
{
|
|
id: "pharmacy",
|
|
labelKey: "nav.pharmacy",
|
|
icon: Cross,
|
|
link: "/pharmacy",
|
|
access: "pharmacy",
|
|
subs: [
|
|
{
|
|
id: "pharmacy-dispensing",
|
|
labelKey: "nav.pharmacy",
|
|
link: "/pharmacy",
|
|
},
|
|
{
|
|
id: "inventory",
|
|
labelKey: "nav.inventory",
|
|
icon: Boxes,
|
|
link: "/inventory",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
id: "lab",
|
|
labelKey: "nav.lab",
|
|
icon: FlaskConical,
|
|
link: "/lab",
|
|
access: "lab",
|
|
},
|
|
{ id: "messages", labelKey: "nav.messages", icon: Mail, link: "/messages" },
|
|
{
|
|
id: "notes",
|
|
labelKey: "nav.notes",
|
|
icon: NotebookPen,
|
|
link: "/notes",
|
|
access: "clinical",
|
|
},
|
|
{ id: "tasks", labelKey: "nav.tasks", icon: ListTodo, link: "/tasks" },
|
|
{
|
|
id: "activity",
|
|
labelKey: "nav.activity",
|
|
icon: History,
|
|
link: "/activity",
|
|
access: "clinical",
|
|
},
|
|
{ id: "settings", labelKey: "nav.settings", icon: Settings, link: "/settings" },
|
|
];
|