feat(dashboard): add dynamic loading for dashboard component
feat(team-account-benefit-statistics): implement benefit statistics card with budget and booking details feat(team-account-health-details): create health details component displaying account health metrics feat(team-account-statistics): develop team account statistics page with charts and customer table feat(load-team-account-health-details): add server-side function to retrieve account health details chore(migrations): create trigger for logging changes in account memberships
This commit is contained in:
@@ -1,15 +1,18 @@
|
||||
'use server';
|
||||
|
||||
import { use } from 'react';
|
||||
|
||||
import { CompanyGuard } from '@/packages/features/team-accounts/src/components';
|
||||
import { createTeamAccountsApi } from '@/packages/features/team-accounts/src/server/api';
|
||||
import { getSupabaseServerClient } from '@/packages/supabase/src/clients/server-client';
|
||||
|
||||
import { AppBreadcrumbs } from '@kit/ui/app-breadcrumbs';
|
||||
import { PageBody } from '@kit/ui/page';
|
||||
import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
|
||||
import { DashboardDemo } from './_components/dashboard-demo';
|
||||
import { Dashboard } from './_components/dashboard';
|
||||
import { TeamAccountLayoutPageHeader } from './_components/team-account-layout-page-header';
|
||||
|
||||
interface TeamAccountHomePageProps {
|
||||
@@ -27,17 +30,23 @@ export const generateMetadata = async () => {
|
||||
|
||||
function TeamAccountHomePage({ params }: TeamAccountHomePageProps) {
|
||||
const account = use(params).account;
|
||||
console.log('TeamAccountHomePage account', account);
|
||||
const client = getSupabaseServerClient();
|
||||
const api = createTeamAccountsApi(client);
|
||||
const teamAccount = use(api.getTeamAccount(account));
|
||||
console.log('teamAccount', teamAccount);
|
||||
return (
|
||||
<>
|
||||
<TeamAccountLayoutPageHeader
|
||||
account={account}
|
||||
title={<Trans i18nKey={'common:routes.dashboard'} />}
|
||||
description={<AppBreadcrumbs />}
|
||||
title={
|
||||
<Trans
|
||||
i18nKey={'teams:home.headerTitle'}
|
||||
values={{ companyName: account }}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
<PageBody>
|
||||
<DashboardDemo />
|
||||
<Dashboard teamAccount={teamAccount} />
|
||||
</PageBody>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user