From ffad5bb96dc22d66b0d45f37feab95136851f1da Mon Sep 17 00:00:00 2001 From: Claude VM Date: Fri, 5 Jun 2026 20:23:17 +0300 Subject: [PATCH] fix(epay-ui): intern CF extracts show a neutral 'Intern' pill, not 'Valid' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cf-intern (copycf) extracts have no validity term (expiresAt is null) — the 30-day 'Valid'/'Expirat' labels only make sense for paid ePay extracts. statusBadge is now type-aware: a completed intern row renders a neutral 'Intern' pill instead of 'Valid'. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../parcel-sync/components/epay-tab.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/modules/parcel-sync/components/epay-tab.tsx b/src/modules/parcel-sync/components/epay-tab.tsx index 8063402..468614f 100644 --- a/src/modules/parcel-sync/components/epay-tab.tsx +++ b/src/modules/parcel-sync/components/epay-tab.tsx @@ -74,7 +74,22 @@ function isActiveStatus(status: string): boolean { type StatusStyle = { label: string; className: string; pulse?: boolean }; -function statusBadge(status: string, expiresAt: string | null): StatusStyle { +function statusBadge( + status: string, + expiresAt: string | null, + type?: "epay" | "intern", +): StatusStyle { + // Intern (copycf) extracts have NO validity term — never label them "Valid" + // or "Expirat" (which imply an ePay-style 30-day validity). Show a neutral + // "Intern" pill instead. + if (type === "intern" && status === "completed") { + return { + label: "Intern", + className: + "bg-sky-100 text-sky-700 border-sky-200 dark:bg-sky-950/40 dark:text-sky-400 dark:border-sky-800", + }; + } + if (status === "completed" && isExpired(expiresAt)) { return { label: "Expirat", @@ -641,7 +656,7 @@ export function EpayTab() { {filteredOrders.map((order, idx) => { - const badge = statusBadge(order.status, order.expiresAt); + const badge = statusBadge(order.status, order.expiresAt, order.type); const expired = order.status === "completed" && isExpired(order.expiresAt);