import Link from 'next/link'; import { ArrowLeft } from 'lucide-react'; import { getSupabaseServerClient } from '@kit/supabase/server-client'; import { Button } from '@kit/ui/button'; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from '@kit/ui/card'; import { CmsPageShell } from '~/components/cms-page-shell'; import { GenerateDocumentForm } from '../_components/generate-document-form'; import { AccountNotFound } from '~/components/account-not-found'; interface PageProps { params: Promise<{ account: string }>; searchParams: Promise<{ type?: string }>; } const DOCUMENT_LABELS: Record = { 'member-card': 'Mitgliedsausweis', invoice: 'Rechnung', labels: 'Etiketten', report: 'Bericht', letter: 'Brief', certificate: 'Zertifikat', }; export default async function GenerateDocumentPage({ params, searchParams, }: PageProps) { const { account } = await params; const { type } = await searchParams; const client = getSupabaseServerClient(); const { data: acct } = await client .from('accounts') .select('id') .eq('slug', account) .single(); if (!acct) return ; const selectedType = type ?? 'member-card'; const selectedLabel = DOCUMENT_LABELS[selectedType] ?? 'Dokument'; return (
{/* Back link */}
Zurück zu Dokumente
{selectedLabel} generieren Wählen Sie den Dokumenttyp und die gewünschten Optionen.
); }