Add AMEV Gleichzeitigkeitsfaktor-Auswähler und einklappbare Seitenleiste

- Gzf-Picker-Modal mit AMEV-Tabelle 3 (Planungshilfe für elektrische
  Leistungsbilanzen) im Projektgerät-Modal und im globalen Geräteformular
- Docker-Deploy-Tooling (docker-start.sh, run-migrations.js) für den
  produktiven Container
- Seitenleiste ist jetzt einklappbar (Icon-only, Zustand in localStorage)
This commit is contained in:
Grovy311 2026-08-03 17:07:14 +02:00
parent 74bea1a3c9
commit 9bd22dfcb7
11 changed files with 349 additions and 41 deletions

View file

@ -14,7 +14,12 @@ const PROJECT_SECTIONS = [
{ id: "projektgeraete", label: "Projektgeräte", icon: "⚙" },
] as const;
export function Sidebar() {
interface SidebarProps {
isCollapsed: boolean;
onToggleCollapsed: () => void;
}
export function Sidebar({ isCollapsed, onToggleCollapsed }: SidebarProps) {
const pathname = usePathname();
const projectMatch = pathname?.match(/^\/projects\/([^/]+)$/);
const activeProjectId = projectMatch ? projectMatch[1] : null;
@ -66,19 +71,31 @@ export function Sidebar() {
}, [activeProjectId]);
return (
<aside className="sidebar">
<aside className={isCollapsed ? "sidebar sidebar-collapsed" : "sidebar"}>
<div className="sidebar-brand">
<div className="sidebar-wordmark">Leistungsbilanz</div>
<div className="sidebar-bar" />
<div className="sidebar-tag">Stromkreis- &amp; Lastberechnung</div>
<div className="sidebar-brand-text">
<div className="sidebar-wordmark">Leistungsbilanz</div>
<div className="sidebar-bar" />
<div className="sidebar-tag">Stromkreis- &amp; Lastberechnung</div>
</div>
<button
aria-label={isCollapsed ? "Seitenleiste ausklappen" : "Seitenleiste einklappen"}
className="sidebar-toggle"
onClick={onToggleCollapsed}
title={isCollapsed ? "Seitenleiste ausklappen" : "Seitenleiste einklappen"}
type="button"
>
{isCollapsed ? "»" : "«"}
</button>
</div>
<nav className="sidebar-nav">
<Link
href="/projects"
className={pathname === "/projects" ? "sidebar-link active" : "sidebar-link"}
title="Alle Projekte"
>
<span className="sidebar-icon">▦</span>
Alle Projekte
<span className="sidebar-label">Alle Projekte</span>
</Link>
<div className="sidebar-section-label">Projekte</div>
@ -89,9 +106,10 @@ export function Sidebar() {
className={
project.id === activeProjectId ? "sidebar-link active" : "sidebar-link"
}
title={project.name}
>
<span className="sidebar-icon">▣</span>
{project.name}
<span className="sidebar-label">{project.name}</span>
</Link>
))}
{!projects.length ? (
@ -108,9 +126,10 @@ export function Sidebar() {
key={id}
href={`#${id}`}
className={activeSection === id ? "sidebar-link active" : "sidebar-link"}
title={label}
>
<span className="sidebar-icon">{icon}</span>
{label}
<span className="sidebar-label">{label}</span>
</a>
))}
</>