feat(plan): grid component with sticky headers and weekend tint
This commit is contained in:
33
src/admin/components/PlanRangeChips.tsx
Normal file
33
src/admin/components/PlanRangeChips.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user