fix(epay-ui): intern CF extracts show a neutral 'Intern' pill, not 'Valid'

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) <noreply@anthropic.com>
This commit is contained in:
Claude VM
2026-06-05 20:23:17 +03:00
parent 50165d2369
commit ffad5bb96d
@@ -74,7 +74,22 @@ function isActiveStatus(status: string): boolean {
type StatusStyle = { label: string; className: string; pulse?: 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)) { if (status === "completed" && isExpired(expiresAt)) {
return { return {
label: "Expirat", label: "Expirat",
@@ -641,7 +656,7 @@ export function EpayTab() {
</thead> </thead>
<tbody> <tbody>
{filteredOrders.map((order, idx) => { {filteredOrders.map((order, idx) => {
const badge = statusBadge(order.status, order.expiresAt); const badge = statusBadge(order.status, order.expiresAt, order.type);
const expired = const expired =
order.status === "completed" && isExpired(order.expiresAt); order.status === "completed" && isExpired(order.expiresAt);