feat(drafts): show Koncept for null numbers in lists + fix filtered empty-state

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-06-09 18:52:34 +02:00
parent a15fa68c3b
commit 52ff0a6ffa
3 changed files with 15 additions and 5 deletions

View File

@@ -49,6 +49,7 @@ import {
statusLabel, statusLabel,
statusColor, statusColor,
statusOptions, statusOptions,
documentNumberLabel,
} from "../lib/documentStatus"; } from "../lib/documentStatus";
const ReceivedInvoices = lazy(() => import("./ReceivedInvoices")); const ReceivedInvoices = lazy(() => import("./ReceivedInvoices"));
@@ -517,7 +518,7 @@ export default function Invoices() {
"&:hover": { textDecoration: "underline" }, "&:hover": { textDecoration: "underline" },
}} }}
> >
{inv.invoice_number} {documentNumberLabel(inv.invoice_number)}
</Box> </Box>
), ),
}, },

View File

@@ -33,6 +33,7 @@ import {
statusLabel, statusLabel,
statusColor, statusColor,
statusOptions, statusOptions,
documentNumberLabel,
} from "../lib/documentStatus"; } from "../lib/documentStatus";
const API_BASE = "/api/admin"; const API_BASE = "/api/admin";
@@ -206,7 +207,7 @@ export default function IssuedOrders({ month, year }: IssuedOrdersProps) {
"&:hover": { textDecoration: "underline" }, "&:hover": { textDecoration: "underline" },
}} }}
> >
{o.po_number || "—"} {documentNumberLabel(o.po_number)}
</Box> </Box>
), ),
}, },

View File

@@ -46,6 +46,7 @@ import {
statusLabel, statusLabel,
statusColor, statusColor,
statusOptions, statusOptions,
documentNumberLabel,
} from "../lib/documentStatus"; } from "../lib/documentStatus";
const API_BASE = "/api/admin"; const API_BASE = "/api/admin";
@@ -543,6 +544,10 @@ export default function Offers() {
label: f.label, label: f.label,
})); }));
// Search/status filter is active → an empty list means "nothing matches"
// (no create CTA); a genuinely empty list keeps the create-CTA empty state.
const isFiltered = !!debouncedSearch || !!statusFilter;
const columns: DataColumn<Quotation>[] = [ const columns: DataColumn<Quotation>[] = [
{ {
key: "quotation_number", key: "quotation_number",
@@ -559,7 +564,7 @@ export default function Offers() {
"&:hover": { textDecoration: "underline" }, "&:hover": { textDecoration: "underline" },
}} }}
> >
{q.quotation_number} {documentNumberLabel(q.quotation_number)}
</Box> </Box>
), ),
}, },
@@ -851,8 +856,11 @@ export default function Offers() {
sortDir={order} sortDir={order}
onSort={handleSort} onSort={handleSort}
empty={ empty={
debouncedSearch ? ( isFiltered ? (
<EmptyState title="Žádné nabídky odpovídající hledání." /> <EmptyState
title="Žádné nabídky neodpovídají filtru"
description="Zkuste změnit filtr nebo hledaný výraz."
/>
) : ( ) : (
<EmptyState <EmptyState
title="Zatím nejsou žádné nabídky." title="Zatím nejsou žádné nabídky."