Files
hats-app/components/ui/badge-status.tsx
T
Ichsan Kurniawan a4f0087b6c Add project detail UI and unified status badges
Introduce project detail screens and reusable status UI. Adds ProjectDetailComponent, WorkOrderCard, StatusTimeline, AssignedPeople, and a new BadgeStatus component with STATUS_BADGE_MAP and STATUS_LIST in badge.tsx to centralize status styling. Adds IProject type (type.project.ts) and project detail page routing. Update existing client/assignment views to use BadgeStatus, improve UI copy and link behavior (ExternalLink icon), handle nullable end dates in forms, include client_id in payload, and improve empty-state handling and descriptions. Misc: rename assignment page export, tweak form labels/placeholders, and small layout/UX refinements.
2026-04-17 17:16:47 +07:00

12 lines
493 B
TypeScript

import { Badge, STATUS_BADGE_MAP } from "@/components/ui/badge"
export default function BadgeStatus({ status, className }: { status: string, className?: string }) { // e.g. status = "UAT"
return (
<Badge variant={STATUS_BADGE_MAP[status?.toLowerCase()] || "default"} className={className}>
{status?.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ')}
</Badge>
)
}