feat(plan): grid component with sticky headers and weekend tint

This commit is contained in:
BOHA
2026-06-05 12:57:41 +02:00
parent ca911bf96c
commit 003807a074
3 changed files with 244 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import { ResolvedCell } from "../lib/queries/plan";
interface Props {
cell: ResolvedCell | null;
readonly?: boolean;
}
const CATEGORY_LABELS: Record<string, string> = {
work: "Práce",
preparation: "Příprava",
travel: "Cesta / Montáž",
leave: "Dovolená",
sick: "Nemoc",
training: "Školení",
other: "Jiné",
};
export default function PlanRangeChips({ cell, readonly }: Props) {
if (!cell) return null;
return (
<div>
<span className={`plan-chip plan-chip--${cell.category}`}>
{CATEGORY_LABELS[cell.category] ?? cell.category}
</span>
{cell.project_id && (
<span style={{ marginLeft: 6, fontSize: 12, fontWeight: 600 }}>
{`#${cell.project_id}`}
</span>
)}
{cell.note && <span className="plan-cell-note">{cell.note}</span>}
</div>
);
}