Kairo-Jinkendo/frontend/src/components/MethodProcessBar.jsx
Lars 09826d146e
Some checks failed
Test Suite / lint-backend (push) Waiting to run
Test Suite / compose-smoke (push) Waiting to run
Test Suite / k6 /api/health Baseline (push) Blocked by required conditions
Test Suite / playwright-smoke (push) Blocked by required conditions
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Has been cancelled
AP1.9d: Methoden-Default-UI und Product Language für Product-Flow.
Prozessleiste, archetypgebundene Modus-Defaults und Sprint/Arbeitspaket-Begriffe schließen den GUI-Kern für continuous_product vor Sprint-Planungs-Flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-12 19:20:06 +02:00

54 lines
1.7 KiB
JavaScript

import { NavLink, useLocation } from 'react-router-dom'
import { useProgramScope } from '../context/ProgramScopeContext.jsx'
import { useMethodUiContext } from '../hooks/useMethodUiContext.js'
import { resolveActiveProcessStepKey } from '../config/methodUiDefaults.js'
export function MethodProcessBar() {
const location = useLocation()
const { initiativeId, hrefWithScope } = useProgramScope()
const { processSteps, archetypeKey, loading } = useMethodUiContext()
if (!initiativeId || loading || processSteps.length === 0) {
return null
}
const activeKey = resolveActiveProcessStepKey(location.pathname, processSteps)
return (
<nav
className="method-process-bar"
aria-label={`Prozess — ${archetypeKey || 'Vorhaben'}`}
>
<ol className="method-process-bar__steps">
{processSteps.map((step, index) => {
const isActive = activeKey === step.key
return (
<li
key={step.key}
className={
'method-process-bar__step' +
(isActive ? ' method-process-bar__step--active' : '')
}
>
{index > 0 && (
<span className="method-process-bar__sep" aria-hidden="true">
</span>
)}
<NavLink
to={hrefWithScope(step.to)}
className={({ isActive: routerActive }) =>
'method-process-bar__link' +
(routerActive || isActive ? ' method-process-bar__link--active' : '')
}
>
{step.label}
</NavLink>
</li>
)
})}
</ol>
</nav>
)
}