feat: add file upload and management features; enhance pagination and permissions handling
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 5m43s
Workflow / ⚫️ Test (push) Has been skipped

This commit is contained in:
T. Zehetbauer
2026-04-01 20:13:15 +02:00
parent db4e19c3af
commit bbb33aa63d
39 changed files with 2858 additions and 99 deletions

View File

@@ -0,0 +1,41 @@
import { createFischereiApi } from '@kit/fischerei/api';
import {
FischereiTabNavigation,
CreatePermitForm,
} from '@kit/fischerei/components';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
interface Props {
params: Promise<{ account: string }>;
}
export default async function NewPermitPage({ params }: Props) {
const { account } = await params;
const client = getSupabaseServerClient();
const { data: acct } = await client
.from('accounts')
.select('id')
.eq('slug', account)
.single();
if (!acct) return <AccountNotFound />;
const api = createFischereiApi(client);
const watersResult = await api.listWaters(acct.id, { pageSize: 200 });
const waters = watersResult.data.map((w: Record<string, unknown>) => ({
id: String(w.id),
name: String(w.name),
}));
return (
<CmsPageShell account={account} title="Neuer Erlaubnisschein">
<FischereiTabNavigation account={account} activeTab="permits" />
<CreatePermitForm accountId={acct.id} account={account} waters={waters} />
</CmsPageShell>
);
}