diff --git a/src/admin/components/PlanCellModal.tsx b/src/admin/components/PlanCellModal.tsx
index 9af8a48..e910f59 100644
--- a/src/admin/components/PlanCellModal.tsx
+++ b/src/admin/components/PlanCellModal.tsx
@@ -7,7 +7,7 @@ import ConfirmModal from "./ConfirmModal";
import useReducedMotion from "../hooks/useReducedMotion";
import {
ResolvedCell,
- PLAN_CATEGORIES,
+ PlanCategory,
planCategoryLabel,
cellProjectLabel,
} from "../lib/queries/plan";
@@ -61,6 +61,7 @@ interface Props {
open: boolean;
mode: PlanCellModalMode;
projects: Project[];
+ categories: PlanCategory[];
onClose: () => void;
onSaveEntry: (body: any) => Promise
- Kategorie: {planCategoryLabel(c.category)} + Kategorie:{" "} + {planCategoryLabel( + c.category, + Object.fromEntries(categories.map((x) => [x.key, x])), + )}
Projekt: {projectLabel || "—"} diff --git a/src/admin/lib/queries/plan.ts b/src/admin/lib/queries/plan.ts index 068f419..e4f8008 100644 --- a/src/admin/lib/queries/plan.ts +++ b/src/admin/lib/queries/plan.ts @@ -53,19 +53,6 @@ export function categoryMap( return map; } -/** Czech labels for the plan_category enum — single source of truth shared - * by the grid chips, the detail view, and aria-labels. */ -export const PLAN_CATEGORIES: ReadonlyArray<{ value: string; label: string }> = - [ - { value: "work", label: "Práce" }, - { value: "preparation", label: "Příprava" }, - { value: "travel", label: "Cesta / Montáž" }, - { value: "leave", label: "Dovolená" }, - { value: "sick", label: "Nemoc" }, - { value: "training", label: "Školení" }, - { value: "other", label: "Jiné" }, - ]; - /** Czech label for a plan category key, resolved from the loaded categories * map, falling back to the raw key. The `map` arg is optional so callers not * yet threading categories still compile (they show the raw key until wired). */ diff --git a/src/admin/pages/PlanWork.tsx b/src/admin/pages/PlanWork.tsx index 23f2d51..de344fb 100644 --- a/src/admin/pages/PlanWork.tsx +++ b/src/admin/pages/PlanWork.tsx @@ -684,6 +684,7 @@ export default function PlanWork() { open={hookModal.kind !== "closed"} mode={modalMode} projects={projects} + categories={categories} onClose={closeModal} onSaveEntry={saveEntry} onUpdateEntry={updateEntryFn}