"use client"; import { useQuery } from "@tanstack/react-query"; import { api } from "@/lib/api"; import type { DocumentTemplate } from "@/lib/types"; import { TEMPLATE_CATEGORY_LABELS } from "@/lib/types"; import { Breadcrumb } from "@/components/layout/Breadcrumb"; import Link from "next/link"; import { FileText, Plus, Loader2, Lock } from "lucide-react"; import { useState } from "react"; const CATEGORIES = ["", "schriftsatz", "vertrag", "korrespondenz", "intern"]; export default function VorlagenPage() { const [category, setCategory] = useState(""); const { data, isLoading } = useQuery({ queryKey: ["templates", category], queryFn: () => api.get<{ data: DocumentTemplate[]; total: number }>( `/templates${category ? `?category=${category}` : ""}`, ), }); const templates = data?.data ?? []; return (
Dokumentvorlagen mit automatischer Befüllung
Keine Vorlagen gefunden
{t.description}
)}