shoc-frontend-new/src/components/domain/status-badge-utils.ts
Adam Moussa 042b9db2ac
Some checks failed
CI / ci (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
chore: correct Sea Haven branding and rewrite README (#25)
* fix: correct Sea Haven branding in page title and wordmark

* chore: use correct company name in docs and comments

* docs: rewrite README

* docs: add README badge block per github-standards

* fix: update command syntax in deployment instructions

* fix: replace template PWA icons and manifest branding

* test: assert PWA manifest branding
2026-07-17 13:17:21 -04:00

31 lines
880 B
TypeScript

import type { StatusVariant } from "./status-badge";
/** Maps API / legacy status strings to Sea Haven status variants. */
const STATUS_ALIASES: Record<string, StatusVariant> = {
open: "incomplete",
incomplete: "incomplete",
pending: "pending",
scheduled: "scheduled",
"in route": "inroute",
inroute: "inroute",
"on site": "onsite",
onsite: "onsite",
"in progress": "inprogress",
inprogress: "inprogress",
done: "completed",
completed: "completed",
complete: "completed",
rescheduled: "rescheduled",
cancelled: "canceled",
canceled: "canceled",
"on hold": "pending",
"pending quote": "pendingquote",
pendingquote: "pendingquote",
"past due": "pastdue",
pastdue: "pastdue",
};
export function resolveStatusVariant(status: string): StatusVariant | null {
const key = status.trim().toLowerCase();
return STATUS_ALIASES[key] ?? null;
}