feat: pre-existing local changes — fischerei, verband, modules, members, packages
Commits all remaining uncommitted local work: - apps/web: fischerei, verband, modules, members-cms, documents, newsletter, meetings, site-builder, courses, bookings, events, finance pages and components - apps/web: marketing page updates, layout, paths config, next.config.mjs, styles/makerkit.css - apps/web/i18n: documents, fischerei, marketing, verband (de+en) - packages/features: finance, fischerei, member-management, module-builder, newsletter, sitzungsprotokolle, verbandsverwaltung server APIs and components - packages/ui: button.tsx updates - pnpm-lock.yaml
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Link from 'next/link';
|
||||
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import { getTranslations } from 'next-intl/server';
|
||||
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { Button } from '@kit/ui/button';
|
||||
@@ -23,15 +24,6 @@ interface PageProps {
|
||||
searchParams: Promise<{ type?: string }>;
|
||||
}
|
||||
|
||||
const DOCUMENT_LABELS: Record<string, string> = {
|
||||
'member-card': 'Mitgliedsausweis',
|
||||
invoice: 'Rechnung',
|
||||
labels: 'Etiketten',
|
||||
report: 'Bericht',
|
||||
letter: 'Brief',
|
||||
certificate: 'Zertifikat',
|
||||
};
|
||||
|
||||
export default async function GenerateDocumentPage({
|
||||
params,
|
||||
searchParams,
|
||||
@@ -39,6 +31,7 @@ export default async function GenerateDocumentPage({
|
||||
const { account } = await params;
|
||||
const { type } = await searchParams;
|
||||
const client = getSupabaseServerClient();
|
||||
const t = await getTranslations('documents');
|
||||
|
||||
const { data: acct } = await client
|
||||
.from('accounts')
|
||||
@@ -49,10 +42,13 @@ export default async function GenerateDocumentPage({
|
||||
if (!acct) return <AccountNotFound />;
|
||||
|
||||
const selectedType = type ?? 'member-card';
|
||||
const selectedLabel = DOCUMENT_LABELS[selectedType] ?? 'Dokument';
|
||||
// Resolve the label from translations; fall back to generic 'Document'
|
||||
const selectedLabel =
|
||||
(t.raw(`types.${selectedType}`) as string | undefined) ??
|
||||
t('generate.document');
|
||||
|
||||
return (
|
||||
<CmsPageShell account={account} title="Dokument generieren">
|
||||
<CmsPageShell account={account} title={t('generate.title')}>
|
||||
<div className="flex w-full flex-col gap-6">
|
||||
{/* Back link */}
|
||||
<div>
|
||||
@@ -61,16 +57,16 @@ export default async function GenerateDocumentPage({
|
||||
className="text-muted-foreground hover:text-foreground inline-flex items-center text-sm"
|
||||
>
|
||||
<ArrowLeft className="mr-1 h-4 w-4" />
|
||||
Zurück zu Dokumente
|
||||
{t('generate.backToDocuments')}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<Card className="max-w-2xl">
|
||||
<CardHeader>
|
||||
<CardTitle>{selectedLabel} generieren</CardTitle>
|
||||
<CardDescription>
|
||||
Wählen Sie den Dokumenttyp und die gewünschten Optionen.
|
||||
</CardDescription>
|
||||
<CardTitle>
|
||||
{t('generate.generateLabel', { label: selectedLabel })}
|
||||
</CardTitle>
|
||||
<CardDescription>{t('generate.chooseOptions')}</CardDescription>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent>
|
||||
@@ -82,7 +78,7 @@ export default async function GenerateDocumentPage({
|
||||
|
||||
<CardFooter>
|
||||
<Link href={`/home/${account}/documents`}>
|
||||
<Button variant="outline">Abbrechen</Button>
|
||||
<Button variant="outline">{t('generate.cancel')}</Button>
|
||||
</Link>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user