feat(project-calendar): add shared Month/Week badge component
This commit is contained in:
parent
3b370205bb
commit
41c4b41046
1 changed files with 18 additions and 0 deletions
18
src/components/project-period-badge.tsx
Normal file
18
src/components/project-period-badge.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in a new issue