// Die Vorgangs-Leiste (5.6.0) — der ganze Weg einer Disc in Stationen, mit // dem Segment-Balken in der aktiven Station. Logik in // gemeinsam/vorgangsleiste.ts; hier nur das Zeichnen. `kompakt` = Punkte // (Verlauf, Warteschlange). import { Fragment } from 'react' import { STATIONS_NAMEN, stationen, stationsZustand, type LeisteStand } from '../../gemeinsam/vorgangsleiste' import { SegmentBalken } from '../bausteine' export function VorgangsLeiste({ stand, restText, kompakt }: { stand: LeisteStand; restText?: string; kompakt?: boolean }) { const liste = stationen(stand.rettung) const zustaende = stationsZustand(liste, stand.station, stand.zustand) const titel = `${STATIONS_NAMEN[stand.station]}: ${ stand.zustand === 'laeuft' ? 'läuft' : stand.zustand === 'wartet' ? 'wartet' : stand.zustand === 'fertig' ? 'fertig' : stand.zustand === 'fehler' ? 'Fehler' : 'abgebrochen' }` if (kompakt) { return ( {liste.map((s, i) => ( ))} ) } return (
{liste.map((s, i) => { const z = zustaende[i] const aktiv = z === 'aktiv' const rahmen = z === 'fehler' ? 'border-rot/50 bg-rot/10' : aktiv ? 'min-w-[200px] flex-1 border-gold/50 bg-gold/10' : z === 'fertig' ? 'border-gold/30 bg-gold/5' : 'border-tinte/10' return ( {i > 0 && }
{z === 'fertig' ? '✓' : z === 'fehler' ? '!' : String(i + 1)} {STATIONS_NAMEN[s].toUpperCase()} {aktiv && stand.zustand === 'laeuft' && stand.prozent >= 0 && (
)} {aktiv && stand.zustand === 'laeuft' && stand.prozent >= 0 && {stand.prozent} %} {aktiv && stand.zustand === 'laeuft' && stand.prozent < 0 && stand.hinweis.length === 0 && ( )} {aktiv && restText !== undefined && restText.length > 0 && {restText}} {aktiv && stand.hinweis.length > 0 && {stand.hinweis}} {z === 'fehler' && {stand.zustand === 'abgebrochen' ? 'abgebrochen' : 'Fehler'}}
) })}
) }