Files
mrp/client/src/modules/projects/config.ts
T
2026-03-17 07:34:08 -05:00

70 lines
2.9 KiB
TypeScript

import type { ProjectInput, ProjectMilestoneStatus, ProjectPriority, ProjectStatus } from "@mrp/shared/dist/projects/types.js";
export const projectStatusOptions: Array<{ value: ProjectStatus; label: string }> = [
{ value: "PLANNED", label: "Planned" },
{ value: "ACTIVE", label: "Active" },
{ value: "ON_HOLD", label: "On Hold" },
{ value: "AT_RISK", label: "At Risk" },
{ value: "COMPLETE", label: "Complete" },
];
export const projectPriorityOptions: Array<{ value: ProjectPriority; label: string }> = [
{ value: "LOW", label: "Low" },
{ value: "MEDIUM", label: "Medium" },
{ value: "HIGH", label: "High" },
{ value: "CRITICAL", label: "Critical" },
];
export const projectStatusFilters: Array<{ value: "ALL" | ProjectStatus; label: string }> = [
{ value: "ALL", label: "All statuses" },
...projectStatusOptions,
];
export const projectPriorityFilters: Array<{ value: "ALL" | ProjectPriority; label: string }> = [
{ value: "ALL", label: "All priorities" },
...projectPriorityOptions,
];
export const projectStatusPalette: Record<ProjectStatus, string> = {
PLANNED: "border border-sky-400/30 bg-sky-500/12 text-sky-700 dark:text-sky-300",
ACTIVE: "border border-emerald-400/30 bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
ON_HOLD: "border border-amber-400/30 bg-amber-500/12 text-amber-700 dark:text-amber-300",
AT_RISK: "border border-rose-400/30 bg-rose-500/12 text-rose-700 dark:text-rose-300",
COMPLETE: "border border-slate-400/30 bg-slate-500/12 text-slate-700 dark:text-slate-300",
};
export const projectPriorityPalette: Record<ProjectPriority, string> = {
LOW: "border border-slate-400/30 bg-slate-500/12 text-slate-700 dark:text-slate-300",
MEDIUM: "border border-sky-400/30 bg-sky-500/12 text-sky-700 dark:text-sky-300",
HIGH: "border border-amber-400/30 bg-amber-500/12 text-amber-700 dark:text-amber-300",
CRITICAL: "border border-rose-400/30 bg-rose-500/12 text-rose-700 dark:text-rose-300",
};
export const projectMilestoneStatusOptions: Array<{ value: ProjectMilestoneStatus; label: string }> = [
{ value: "PLANNED", label: "Planned" },
{ value: "IN_PROGRESS", label: "In Progress" },
{ value: "BLOCKED", label: "Blocked" },
{ value: "COMPLETE", label: "Complete" },
];
export const projectMilestoneStatusPalette: Record<ProjectMilestoneStatus, string> = {
PLANNED: "border border-sky-400/30 bg-sky-500/12 text-sky-700 dark:text-sky-300",
IN_PROGRESS: "border border-emerald-400/30 bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
BLOCKED: "border border-rose-400/30 bg-rose-500/12 text-rose-700 dark:text-rose-300",
COMPLETE: "border border-slate-400/30 bg-slate-500/12 text-slate-700 dark:text-slate-300",
};
export const emptyProjectInput: ProjectInput = {
name: "",
status: "PLANNED",
priority: "MEDIUM",
customerId: "",
salesQuoteId: null,
salesOrderId: null,
shipmentId: null,
ownerId: null,
dueDate: null,
notes: "",
milestones: [],
};