feat(billing): enhance health benefit form and yearly expenses overview with employee count and loading state

This commit is contained in:
Danel Kungla
2025-08-11 15:04:16 +03:00
parent 6e63646944
commit 9298abe354
6 changed files with 79 additions and 39 deletions

View File

@@ -1,3 +1,4 @@
import { createAccountsApi } from '@/packages/features/accounts/src/server/api';
import { createTeamAccountsApi } from '@/packages/features/team-accounts/src/server/api';
import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-client';
@@ -23,13 +24,20 @@ export const generateMetadata = async () => {
async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
const accountSlug = (await params).account;
const api = createTeamAccountsApi(getSupabaseServerClient());
const client = getSupabaseServerClient();
const api = createTeamAccountsApi(client);
const account = await api.getTeamAccount(accountSlug);
const companyParams = await api.getTeamAccountParams(account.id);
const accounts = await api.getMembers(accountSlug);
return (
<PageBody>
<HealthBenefitForm account={account} companyParams={companyParams} />
<HealthBenefitForm
account={account}
companyParams={companyParams}
employeeCount={accounts.length}
/>
</PageBody>
);
}