Files
myeasycms-v2/apps/web/app/[locale]/home/[account]/members-cms/invitations/page.tsx
T. Zehetbauer db4e19c3af
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 4m53s
Workflow / ⚫️ Test (push) Has been skipped
feat: add invitations management and import wizard; enhance audit logging and member detail fetching
2026-04-01 19:02:55 +02:00

49 lines
1.4 KiB
TypeScript

import { createMemberManagementApi } from '@kit/member-management/api';
import { getSupabaseServerClient } from '@kit/supabase/server-client';
import { AccountNotFound } from '~/components/account-not-found';
import { CmsPageShell } from '~/components/cms-page-shell';
import { InvitationsView } from './invitations-view';
interface Props {
params: Promise<{ account: string }>;
}
export default async function InvitationsPage({ 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 = createMemberManagementApi(client);
const invitations = await api.listPortalInvitations(acct.id);
// Fetch members for the "send invitation" dialog
const { data: members } = await client
.from('members')
.select('id, first_name, last_name, email')
.eq('account_id', acct.id)
.eq('status', 'active')
.order('last_name');
return (
<CmsPageShell
account={account}
title="Portal-Einladungen"
description="Einladungen zum Mitgliederportal verwalten"
>
<InvitationsView
invitations={invitations}
members={members ?? []}
accountId={acct.id}
account={account}
/>
</CmsPageShell>
);
}