shoc-frontend-new/src/domain/work-orders/utils/reschedule-indicator.ts
Arthur Bassi 7a30335ab8 feat(work-orders): add per-WO Aveta indicators and advanced filter
Dispatchers can flag Aveta on Service and Notes and filter those rows
without a site-level attribute.
2026-08-24 15:16:51 -03:00

16 lines
672 B
TypeScript

import { fmtDate } from "@/domain/work-orders/utils/wizard-date-utils";
export function formatRescheduleCountLabel(count: number): string {
return count === 1 ? "1 time" : `${count} times`;
}
/** Hover copy for the Reschedule pill (count ≥ 2). Uses originalDate when the API sends it. */
export function formatRescheduleHover(count: number, originalDate?: string): string {
const times = formatRescheduleCountLabel(count);
const base = `Rescheduled ${times} — this WO has had its date changed ${times}.`;
const formatted = originalDate ? fmtDate(originalDate) : "";
if (!formatted) {
return base;
}
return `${base} Original date: ${formatted}.`;
}