Add customer registration and deployment updates

This commit is contained in:
2026-03-12 16:02:16 +01:00
parent fb8e3c8ef6
commit 8ebb4d06e5
23 changed files with 851 additions and 425 deletions

View File

@@ -1,13 +1,6 @@
import { NavLink, Outlet, useLocation, useNavigate } from "react-router-dom";
import { useSession } from "../lib/session";
const NAV_ITEMS = [
{ to: "/home", label: "Start" },
{ to: "/samples/new", label: "Neue Probe" },
{ to: "/admin", label: "Verwaltung" },
{ to: "/portal", label: "Portal" },
];
const PAGE_TITLES: Record<string, string> = {
"/home": "Startseite",
"/samples/new": "Neuanlage einer Probe",
@@ -35,6 +28,14 @@ export default function AppShell() {
const { user, setUser } = useSession();
const location = useLocation();
const navigate = useNavigate();
const navItems = user?.role === "ADMIN"
? [{ to: "/portal", label: "Benutzerverwaltung" }]
: [
{ to: "/home", label: "Start" },
{ to: "/samples/new", label: "Neue Probe" },
{ to: "/admin", label: "Verwaltung" },
{ to: "/portal", label: "Portal" },
];
return (
<div className="app-shell">
@@ -44,7 +45,7 @@ export default function AppShell() {
</div>
<nav className="sidebar__nav">
{NAV_ITEMS.map((item) => (
{navItems.map((item) => (
<NavLink
key={item.to}
to={item.to}
@@ -78,12 +79,6 @@ export default function AppShell() {
<div className="topbar__headline">
<h2>{resolvePageTitle(location.pathname)}</h2>
</div>
<div className="topbar__actions">
<button type="button" className="accent-button" onClick={() => navigate("/samples/new")}>
Neuanlage
</button>
</div>
</header>
<main className="content-area">