chore: consolidate platform split checks
Some checks failed
Dependency Audit / dependency-audit (push) Has been cancelled
Module Matrix / module-matrix (push) Has been cancelled

This commit is contained in:
2026-07-10 12:51:19 +02:00
parent 150b720f12
commit 635d25c74c
216 changed files with 23336 additions and 4077 deletions

View File

@@ -1,3 +1,5 @@
import { usePlatformLanguage } from "../i18n/LanguageContext";
export type ModuleSubnavItem<T extends string> = {
id: T;
label: string;
@@ -29,34 +31,35 @@ export default function ModuleSubnav<T extends string>({
groups,
onSelect,
className = ""
}: {
active: T;
groups: ModuleSubnavGroup<T>[];
onSelect: (section: T) => void;
className?: string;
}) {
}: {active: T;groups: ModuleSubnavGroup<T>[];onSelect: (section: T) => void;className?: string;}) {
const { translateText } = usePlatformLanguage();
return (
<aside className={`section-sidebar ${className}`.trim()}>
{groups.map((group, groupIndex) => (
<div className="section-group" key={`${group.title ?? "group"}-${groupIndex}`}>
{group.title && <div className={`section-title ${groupIndex > 0 ? "section-title-lower" : ""}`.trim()}>{group.title}</div>}
{groups.map((group, groupIndex) =>
<div className="section-group" key={`${group.title ?? "group"}-${groupIndex}`}>
{group.title && <div className={`section-title ${groupIndex > 0 ? "section-title-lower" : ""}`.trim()}>{translateText(group.title)}</div>}
{group.items.map((entry) => {
const key = isAction(entry) ? entry.actionId : entry.id;
const activeClass = !isAction(entry) && active === entry.id ? " active" : "";
const primaryClass = entry.primary ? " section-link-primary" : "";
const subtleClass = entry.subtle ? " subtle" : "";
return (
<button
key={key}
className={`section-link${primaryClass}${subtleClass}${activeClass}`}
onClick={() => (isAction(entry) ? entry.onClick() : onSelect(entry.id))}
>
{entry.label}
</button>
);
})}
const key = isAction(entry) ? entry.actionId : entry.id;
const activeClass = !isAction(entry) && active === entry.id ? " active" : "";
const primaryClass = entry.primary ? " section-link-primary" : "";
const subtleClass = entry.subtle ? " subtle" : "";
return (
<button
key={key}
className={`section-link${primaryClass}${subtleClass}${activeClass}`}
onClick={() => isAction(entry) ? entry.onClick() : onSelect(entry.id)}>
{translateText(entry.label)}
</button>);
})}
</div>
))}
</aside>
);
)}
</aside>);
}