Kairo-Jinkendo/frontend/src/components/GateGraphStateBadge.jsx
Lars 1fa61b2dac
Some checks failed
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Failing after 2m18s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
AP1.4e: Methodenprofile am Gate-Graph.
generic_operating ohne harte Blockade, Reifegrad-Methoden mit Erfuellungsgrad; Attention gate_graph_blocked fuer gate-orientierte Methoden.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-11 08:06:42 +02:00

32 lines
860 B
JavaScript

import { gateTitleById } from './GateSelect.jsx'
export function GateGraphStateBadge({ graphState, itemId, siblingItems = [] }) {
if (!graphState?.items?.[itemId]) return null
if (graphState.graph_profile?.enforce_gate_blocking === false) {
return null
}
const { blocked, ready, blocked_by: blockedBy = [] } = graphState.items[itemId]
if (ready) {
return <span className="status-pill status-pill--ready">Bereit</span>
}
if (blocked) {
const blockerTitle =
blockedBy.length === 1 ? gateTitleById(siblingItems, blockedBy[0]) : null
const title =
blockerTitle != null
? `Blockiert durch ${blockerTitle}`
: `Blockiert (${blockedBy.length} Voraussetzungen)`
return (
<span className="status-pill status-pill--blocked" title={title}>
Blockiert
</span>
)
}
return null
}