refactor(ui): single shared documentStatus map across offers/invoices/orders (fix issued color drift, add offers status chip)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,7 @@ import {
|
||||
PageEnter,
|
||||
headerActionsSx,
|
||||
} from "../ui";
|
||||
import { OFFER_STATUS, statusLabel, statusColor } from "../lib/documentStatus";
|
||||
|
||||
const API_BASE = "/api/admin";
|
||||
const DRAFT_KEY = "boha_offer_draft";
|
||||
@@ -1124,10 +1125,17 @@ export default function OfferDetail() {
|
||||
<Typography variant="h4">
|
||||
{isEdit ? `Nabídka ${form.quotation_number}` : "Nová nabídka"}
|
||||
</Typography>
|
||||
{isInvalidated && (
|
||||
<StatusChip label="Zneplatněna" color="error" />
|
||||
)}
|
||||
{isCompleted && <StatusChip label="Dokončeno" color="success" />}
|
||||
{isEdit &&
|
||||
(isCompleted ? (
|
||||
// Completed is derived from the linked order, not the offer's
|
||||
// own status — surface it (success) over the base chip.
|
||||
<StatusChip label="Dokončená" color="success" />
|
||||
) : (
|
||||
<StatusChip
|
||||
label={statusLabel(OFFER_STATUS, offerStatus)}
|
||||
color={statusColor(OFFER_STATUS, offerStatus)}
|
||||
/>
|
||||
))}
|
||||
</Box>
|
||||
</Box>
|
||||
<Box sx={headerActionsSx}>
|
||||
|
||||
Reference in New Issue
Block a user