Files
medreport_mrb2b/app/home/[account]/billing/page.tsx
Danel Kungla cdf1491e53 refactor(auth): remove personal code from sign-up flow and update related components
feat(i18n): update translations for company account creation and get started
2025-08-21 21:32:03 +03:00

45 lines
1.3 KiB
TypeScript

import { createTeamAccountsApi } from '@/packages/features/team-accounts/src/server/api';
import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-client';
import { PageBody } from '@kit/ui/page';
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';
import HealthBenefitForm from './_components/health-benefit-form';
interface TeamAccountBillingPageProps {
params: Promise<{ account: string }>;
}
export const generateMetadata = async () => {
const i18n = await createI18nServerInstance();
const title = i18n.t('teams:billing.pageTitle');
return {
title,
};
};
async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
const accountSlug = (await params).account;
const client = getSupabaseServerClient();
const api = createTeamAccountsApi(client);
const account = await api.getTeamAccount(accountSlug);
const companyParams = await api.getTeamAccountParams(account.id);
const { members } = await api.getMembers(accountSlug);
return (
<PageBody>
<HealthBenefitForm
account={account}
companyParams={companyParams}
employeeCount={members.length}
/>
</PageBody>
);
}
export default withI18n(TeamAccountBillingPage);