import { h, Fragment } from "../jsx";
import { FIRM } from "../branding";
const ICON_HOME = '';
const ICON_CALC = '';
const ICON_CLOCK = '';
const ICON_DOWNLOAD = '';
const ICON_LINK = '';
const ICON_BOOK = '';
// Open-book icon for the /tools/verfahrensablauf "Verfahrensablauf"
// nav entry (t-paliad-168 → t-paliad-179 Slice 1 split). Distinct from
// ICON_BOOK (Glossar, closed) so the two affordances read as different
// at a glance.
const ICON_BOOK_OPEN = '';
const ICON_TABLE = '';
// Document-with-lines icon for /submissions (t-paliad-240) — distinct
// from ICON_BOOK / ICON_BOOK_OPEN / ICON_NEWSPAPER so the Schriftsätze
// affordance reads as "a draft document" at a glance.
const ICON_FILE_TEXT = '';
const ICON_CHECK = '';
const ICON_GLOBE = '';
const ICON_BUILDING = '';
const ICON_LOGOUT = '';
const ICON_PIN = '';
const ICON_MENU = '';
const ICON_FOLDER = '';
const ICON_CALENDAR = '';
const ICON_GAUGE = '';
const ICON_GEAR = '';
const ICON_MAIL = '';
const ICON_SEARCH = '';
const ICON_SPARKLE = '';
const ICON_USERS = '';
const ICON_SHIELD = '';
const ICON_AUDIT_LOG = '';
// Newspaper icon for the /changelog "Neuigkeiten" entry. Sparkle is now
// reserved for the Paliadin AI surface so the two affordances don't
// share a glyph (m's 2026-05-08 21:11 dogfood).
const ICON_NEWSPAPER = '';
// Bell icon for the /inbox entry (t-paliad-138 4-eye approval inbox).
const ICON_BELL = '';
// Theme-toggle icons. The button cycles auto → light → dark → auto, and
// the icon swaps to reflect the *current* preference (auto/light/dark)
// — not the eventual click target. SSR renders the auto variant; the
// runtime client (sidebar.ts) re-renders the matching icon on hydration
// after reading localStorage.
const ICON_THEME_AUTO = '';
const ICON_THEME_LIGHT = '';
const ICON_THEME_DARK = '';
interface SidebarProps {
currentPath: string;
// authenticated defaults to true; pass false on anon-facing pages (the
// marketing landing) so we don't render auth-only affordances that would
// fire 401s. Currently gates only the changelog badge link — the badge
// client (sidebar.ts initChangelogBadge) early-returns when the link is
// absent, so there is no client change needed.
authenticated?: boolean;
}
function navItem(href: string, icon: string, i18nKey: string, label: string, currentPath: string, badgeID?: string): string {
// "Active" is true for the item whose href is a prefix of currentPath.
// That way sub-routes like /projekte/{id}/events keep the /projekte entry lit.
// /akten and /akten/* are kept as legacy aliases and also highlight /projekte
const active =
href === currentPath ||
(href !== "/" && currentPath.startsWith(href + "/"));
return (
{label}
{badgeID ? : ""}
);
}
function navItemDisabled(icon: string, i18nKey: string, label: string, tooltipI18n: string, tooltipText: string): string {
return (
{label}
);
}
function group(i18nKey: string, label: string, children: string): string {
return (
{label}
{children}
);
}
export function Sidebar({ currentPath, authenticated = true }: SidebarProps): string {
return (
{/* Invitation modal — lives alongside the sidebar so every page can
open it. Hidden by default; sidebar.ts toggles display. */}
Kolleg:in zu Paliad einladen
{`Senden Sie eine Einladung an eine ${FIRM}-E-Mail-Adresse. Die Empfänger:in erhält einen Registrierungslink.`}