fix(bestellungen): use status label as button text, all progress buttons blue, keep red for reject only

This commit is contained in:
Matthias Hochmeister
2026-04-15 14:03:54 +02:00
parent 6ff531f79c
commit c3fcbd1467

View File

@@ -825,20 +825,15 @@ export default function BestellungDetail() {
return canCreate || canManageOrders;
})
.map((s) => {
const isApprove = bestellung.status === 'wartet_auf_genehmigung' && s === 'bereit_zur_bestellung';
const isReject = bestellung.status === 'wartet_auf_genehmigung' && s === 'entwurf';
const label = isApprove
? 'Genehmigen'
: isReject
? 'Ablehnen'
: `Status: ${BESTELLUNG_STATUS_LABELS[s]}`;
const color = isApprove ? 'success' : isReject ? 'error' : 'primary';
const label = isReject ? 'Ablehnen' : BESTELLUNG_STATUS_LABELS[s];
const color = isReject ? 'error' : 'primary';
const isAbgeschlossen = s === 'abgeschlossen';
return (
<Button
key={s}
variant="contained"
color={color as 'success' | 'error' | 'primary'}
color={color as 'error' | 'primary'}
disabled={isAbgeschlossen && (!allCostsEntered || !allItemsReceived)}
onClick={() => { setStatusForce(false); setStatusConfirmTarget(s); }}
>