mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-04 09:02:05 +00:00
* 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
31 lines
880 B
TypeScript
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;
|
|
}
|