2026-07-10 14:26:14 +02:00
|
|
|
/**
|
|
|
|
|
* Kontrolle-Subnav (Mitai: settingsNav / analysis-split).
|
|
|
|
|
* Pfade müssen mit Routes in App.jsx übereinstimmen.
|
|
|
|
|
*
|
|
|
|
|
* @typedef {{ key: string, to: string, label: string }} ModeNavItem
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/** @type {ModeNavItem[]} */
|
|
|
|
|
export const CONTROL_NAV_ITEMS = [
|
|
|
|
|
{ key: 'status', to: '/control/status', label: 'Steuerung' },
|
2026-07-11 08:10:15 +02:00
|
|
|
{ key: 'plan-ist', to: '/control/plan-ist', label: 'Plan / Ist' },
|
2026-07-10 14:26:14 +02:00
|
|
|
{ key: 'journey', to: '/control/journey', label: 'Nachvollziehbarkeit' },
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {string} pathname
|
|
|
|
|
* @returns {string | null}
|
|
|
|
|
*/
|
|
|
|
|
export function resolveControlNavActiveKey(pathname) {
|
|
|
|
|
const path = pathname.replace(/\/$/, '') || pathname
|
|
|
|
|
const match = CONTROL_NAV_ITEMS.find(
|
|
|
|
|
(item) => path === item.to || path.startsWith(`${item.to}/`),
|
|
|
|
|
)
|
|
|
|
|
return match?.key ?? null
|
|
|
|
|
}
|