feat(project-calendar): add shared Month/Week badge component

This commit is contained in:
DEls 2026-09-11 22:24:45 +02:00
parent 3b370205bb
commit 41c4b41046

View file

@ -0,0 +1,18 @@
// src/components/project-period-badge.tsx
import { Badge } from "@/components/ui/badge";
import type { ProjectPeriodLabel } from "@/lib/project-calendar";
/**
* "M{month} · W{week}" tag for a row, or an em-dash when the row's site
* has no job_start_date set yet (see project-calendar.ts).
*/
export function ProjectPeriodBadge({ period }: { period: ProjectPeriodLabel | null }) {
if (!period) {
return <span className="text-xs text-muted-foreground">—</span>;
}
return (
<Badge variant="outline" className="font-mono text-[10px] whitespace-nowrap">
M{period.projectMonth} · W{period.projectWeek}
</Badge>
);
}