fix(bestellungen): use status label as button text, all progress buttons blue, keep red for reject only
This commit is contained in:
@@ -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); }}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user