// Shared primitives const Badge = ({tone='neutral', children, dot=true}) => ( {dot && }{children} ); const StatusBadge = ({status}) => { const s = STATUS_LABELS[status]; return {s.label}; }; const UrgencyBadge = ({u}) => { const x = URGENCY[u]; return {x.l}; }; const RoleBadge = ({role}) => { const map = { verwaltung:{c:'admin', l:'Verwaltung'}, admin:{c:'admin', l:'Admin'}, sach:{c:'sach', l:'Sachbearbeiter'}, hauswart:{c:'hauswart', l:'Hauswart'}, mieter:{c:'mieter', l:'Mieter'} }; const r = map[role] || {c:'admin', l: role||'—'}; return {r.l}; }; const Avatar = ({initials, tone='', size=''}) => ( {initials} ); const Button = ({variant='', size='', children, leftIcon, rightIcon, onClick, className=''}) => ( ); const SidebarItem = ({icon, label, count, dot, active, onClick}) => (
{label} {count !== undefined && {count}} {dot && }
); const SidebarSection = ({title, children}) => ( <>
{title}
{children} ); const PageHeader = ({eyebrow, title, sub, actions}) => (
{eyebrow &&
{eyebrow}
}

{title}

{sub &&
{sub}
}
{actions &&
{actions}
}
); const Card = ({title, action, children, className=''}) => (
{title && (
{title}
{action}
)}
{children}
); const KPI = ({label, value, unit, delta, deltaDir}) => (
{label}
{value}{unit && {unit}}
{delta &&
{delta}
}
); const Sparkline = ({points, color='currentColor'}) => { const w=100, h=34; const min=Math.min(...points), max=Math.max(...points); const d = points.map((p,i)=>{ const x = (i/(points.length-1))*w; const y = h - ((p-min)/(max-min||1))*h; return `${i?'L':'M'}${x.toFixed(1)} ${y.toFixed(1)}`; }).join(' '); return ( ); }; const Search = ({placeholder='Suchen...', value, onChange}) => (
onChange?.(e.target.value)}/> ⌘K
); const Placeholder = ({label, h=120}) => (
{label}
); Object.assign(window, { Badge, StatusBadge, UrgencyBadge, RoleBadge, Avatar, Button, SidebarItem, SidebarSection, PageHeader, Card, KPI, Sparkline, Search, Placeholder });