diff --git a/frontend/src/components/cases/CaseForm.tsx b/frontend/src/components/cases/CaseForm.tsx index 024c85a..7d65f3b 100644 --- a/frontend/src/components/cases/CaseForm.tsx +++ b/frontend/src/components/cases/CaseForm.tsx @@ -1,16 +1,14 @@ "use client"; import { useState } from "react"; +import { useQuery } from "@tanstack/react-query"; +import { api } from "@/lib/api"; +import type { ProceedingType } from "@/lib/types"; -const TYPE_OPTIONS = [ - { value: "", label: "-- Typ wählen --" }, - { value: "INF", label: "Verletzungsklage (INF)" }, - { value: "REV", label: "Widerruf (REV)" }, - { value: "CCR", label: "Einstweilige Verfügung (CCR)" }, - { value: "APP", label: "Berufung (APP)" }, - { value: "PI", label: "Vorläufiger Rechtsschutz (PI)" }, - { value: "ZPO_CIVIL", label: "ZPO Zivilverfahren" }, -]; +const JURISDICTION_LABELS: Record = { + UPC: "UPC-Verfahren", + DE: "Deutsche Patentverfahren", +}; export interface CaseFormData { case_number: string; @@ -34,6 +32,10 @@ export function CaseForm({ isSubmitting, submitLabel = "Akte anlegen", }: CaseFormProps) { + const { data: proceedingTypes } = useQuery({ + queryKey: ["proceeding-types"], + queryFn: () => api.get("/proceeding-types"), + }); const [form, setForm] = useState({ case_number: initialData?.case_number ?? "", title: initialData?.title ?? "", @@ -139,11 +141,24 @@ export function CaseForm({ onChange={(e) => update("case_type", e.target.value)} className={inputClass} > - {TYPE_OPTIONS.map((o) => ( - - ))} + + {(() => { + const grouped = new Map(); + for (const pt of proceedingTypes ?? []) { + const key = pt.jurisdiction ?? "Sonstige"; + if (!grouped.has(key)) grouped.set(key, []); + grouped.get(key)!.push(pt); + } + return Array.from(grouped.entries()).map(([jurisdiction, types]) => ( + + {types.map((pt) => ( + + ))} + + )); + })()}
diff --git a/frontend/src/components/deadlines/DeadlineCalculator.tsx b/frontend/src/components/deadlines/DeadlineCalculator.tsx index 806728a..c932f6f 100644 --- a/frontend/src/components/deadlines/DeadlineCalculator.tsx +++ b/frontend/src/components/deadlines/DeadlineCalculator.tsx @@ -85,11 +85,27 @@ export function DeadlineCalculator() { className={inputClass} > - {proceedingTypes?.map((pt) => ( - - ))} + {(() => { + const grouped = new Map(); + for (const pt of proceedingTypes ?? []) { + const key = pt.jurisdiction ?? "Sonstige"; + if (!grouped.has(key)) grouped.set(key, []); + grouped.get(key)!.push(pt); + } + const labels: Record = { + UPC: "UPC-Verfahren", + DE: "Deutsche Patentverfahren", + }; + return Array.from(grouped.entries()).map(([jurisdiction, types]) => ( + + {types.map((pt) => ( + + ))} + + )); + })()}
diff --git a/frontend/src/components/deadlines/DeadlineWizard.tsx b/frontend/src/components/deadlines/DeadlineWizard.tsx index 751a29d..38e2a12 100644 --- a/frontend/src/components/deadlines/DeadlineWizard.tsx +++ b/frontend/src/components/deadlines/DeadlineWizard.tsx @@ -276,32 +276,53 @@ export function DeadlineWizard() { )}
-
+
{typesLoading ? ( -
+
) : ( - proceedingTypes?.map((pt) => ( - + ))} +
-
{pt.name}
- - )) + )); + })() )}
@@ -444,7 +465,7 @@ export function DeadlineWizard() {

- UPC-Fristenbestimmung + Fristenbestimmung

Waehlen Sie die Verfahrensart und geben Sie das Datum des ausloesenden Ereignisses ein.