feat(billing): enhance health benefit form and yearly expenses overview with employee count and loading state
This commit is contained in:
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user