feat: add cross-organization member search and template cloning functionality
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
||||
import { createVerbandApi } from '@kit/verbandsverwaltung/api';
|
||||
import {
|
||||
VerbandTabNavigation,
|
||||
HierarchyReport,
|
||||
} from '@kit/verbandsverwaltung/components';
|
||||
|
||||
import { AccountNotFound } from '~/components/account-not-found';
|
||||
import { CmsPageShell } from '~/components/cms-page-shell';
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ account: string }>;
|
||||
}
|
||||
|
||||
export default async function ReportingPage({ params }: PageProps) {
|
||||
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 = createVerbandApi(client);
|
||||
|
||||
const [summary, report] = await Promise.all([
|
||||
api.getHierarchySummary(acct.id),
|
||||
api.getHierarchyReport(acct.id),
|
||||
]);
|
||||
|
||||
return (
|
||||
<CmsPageShell
|
||||
account={account}
|
||||
title="Verbandsverwaltung - Berichte"
|
||||
description="Aggregierte Berichte und Kennzahlen aller Organisationen im Verband"
|
||||
>
|
||||
<VerbandTabNavigation account={account} activeTab="reporting" />
|
||||
<HierarchyReport summary={summary} report={report} />
|
||||
</CmsPageShell>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user