feat(MED-97): update benefit stats view in dashboards

This commit is contained in:
2025-09-26 13:47:32 +03:00
parent fdc2e3e064
commit 1aeee0bc30
23 changed files with 518 additions and 374 deletions

View File

@@ -7,6 +7,7 @@ import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';
import HealthBenefitForm from './_components/health-benefit-form';
import { loadTeamAccountBenefitExpensesOverview } from '../_lib/server/load-team-account-benefit-expenses-overview';
interface TeamAccountBillingPageProps {
params: Promise<{ account: string }>;
@@ -27,8 +28,14 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
const api = createTeamAccountsApi(client);
const account = await api.getTeamAccount(accountSlug);
const companyParams = await api.getTeamAccountParams(account.id);
const { members } = await api.getMembers(accountSlug);
const [expensesOverview, companyParams] = await Promise.all([
loadTeamAccountBenefitExpensesOverview({
companyId: account.id,
employeeCount: members.length,
}),
api.getTeamAccountParams(account.id),
]);
return (
<PageBody>
@@ -36,6 +43,7 @@ async function TeamAccountBillingPage({ params }: TeamAccountBillingPageProps) {
account={account}
companyParams={companyParams}
employeeCount={members.length}
expensesOverview={expensesOverview}
/>
</PageBody>
);