diff --git a/frontend/src/layout/AppShell.tsx b/frontend/src/layout/AppShell.tsx index b5b9227..92eb6b0 100644 --- a/frontend/src/layout/AppShell.tsx +++ b/frontend/src/layout/AppShell.tsx @@ -9,7 +9,7 @@ const PAGE_TITLES: Record = { "/report-template": "Bericht", }; -function resolvePageTitle(pathname: string) { +function resolvePageTitle(pathname: string, isAdmin: boolean) { if (pathname.includes("/anamnesis")) { return "Anamnese"; } @@ -22,29 +22,8 @@ function resolvePageTitle(pathname: string) { if (pathname.includes("/registration")) { return "Probe bearbeiten"; } - if (pathname.startsWith("/admin/landwirte")) { - return "Die Verwaltung der Landwirte"; - } if (pathname.startsWith("/admin/benutzer")) { - return "Verwaltung | Benutzer"; - } - if (pathname.startsWith("/admin/medikamente")) { - return "Die Verwaltung der Medikamente"; - } - if (pathname.startsWith("/admin/erreger")) { - return "Die Verwaltung der Erreger"; - } - if (pathname.startsWith("/admin/antibiogramm")) { - return "Die Verwaltung der Antibiogramme"; - } - if (pathname.startsWith("/search/landwirt")) { - return "Suche | Landwirt"; - } - if (pathname.startsWith("/search/probe")) { - return "Suche | Probe"; - } - if (pathname.startsWith("/search/kalendar")) { - return "Suche | Kalendar"; + return isAdmin ? "Benutzerfreigabe" : "Verwaltung | Benutzer"; } return PAGE_TITLES[pathname] ?? "MUH App"; } @@ -75,45 +54,10 @@ export default function AppShell() {
-
Verwaltung
+
Benutzerverwaltung
-
-
Vorlagen
-
- `nav-sublink ${isActive ? "is-active" : ""}`}> - Bericht - -
-
- `nav-sublink ${isActive ? "is-active" : ""}`}> - Landwirte - - `nav-sublink ${isActive ? "is-active" : ""}`}> - Medikamente - - `nav-sublink ${isActive ? "is-active" : ""}`}> - Erreger - - `nav-sublink ${isActive ? "is-active" : ""}`}> - Antibiogramm - `nav-sublink ${isActive ? "is-active" : ""}`}> - Benutzer - -
-
- -
-
Suche
-
- `nav-sublink ${isActive ? "is-active" : ""}`}> - Landwirt - - `nav-sublink ${isActive ? "is-active" : ""}`}> - Probe - - `nav-sublink ${isActive ? "is-active" : ""}`}> - Kalendar + Freigabe / Sperre
@@ -203,7 +147,7 @@ export default function AppShell() {
-

{resolvePageTitle(location.pathname)}

+

{resolvePageTitle(location.pathname, user?.role === "ADMIN")}