diff --git a/app/home/[account]/_components/team-account-benefit-statistics.tsx b/app/home/[account]/_components/team-account-benefit-statistics.tsx
index 4b0a017..95f35a6 100644
--- a/app/home/[account]/_components/team-account-benefit-statistics.tsx
+++ b/app/home/[account]/_components/team-account-benefit-statistics.tsx
@@ -88,35 +88,70 @@ const TeamAccountBenefitStatistics = ({
- Analüüsid
+
+
+
18 %
- 36 broneeringut
+
+
+
- Eriarstid ja spetsialistid
+
+
+
22 %
- 44 broneeringut
+
+
+
- Uuringud
+
+
+
20 %
- 40 broneeringut
+
+
+
E-konsultatsioon
17 %
- 34 broneeringut
+
+
+
- Terviseuuringute paketid
+
+
+
23 %
- 46 teenuse kasutust
+
+
+
1800 €
- Teenuste summa
+
+
+
diff --git a/app/home/[account]/_components/team-account-health-details.tsx b/app/home/[account]/_components/team-account-health-details.tsx
index 9e599cf..904a2bc 100644
--- a/app/home/[account]/_components/team-account-health-details.tsx
+++ b/app/home/[account]/_components/team-account-health-details.tsx
@@ -1,19 +1,26 @@
import React from 'react';
import { Card } from '@kit/ui/card';
+import { Trans } from '@kit/ui/trans';
import { cn } from '@kit/ui/utils';
import {
NormStatus,
getAccountHealthDetailsFields,
} from '../_lib/server/load-team-account-health-details';
+import { TeamAccountStatisticsProps } from './team-account-statistics';
-const TeamAccountHealthDetails = () => {
- const accountHealthDetailsFields = getAccountHealthDetailsFields();
+const TeamAccountHealthDetails = ({
+ memberParams,
+}: {
+ memberParams: TeamAccountStatisticsProps['memberParams'];
+}) => {
+ const accountHealthDetailsFields =
+ getAccountHealthDetailsFields(memberParams);
return (
{accountHealthDetailsFields.map(({ title, Icon, value, normStatus }) => (
-
+
{
>
- {title}
+
+
+
{value}
))}
diff --git a/app/home/[account]/_components/team-account-statistics.tsx b/app/home/[account]/_components/team-account-statistics.tsx
index 4dac5ae..98b0b83 100644
--- a/app/home/[account]/_components/team-account-statistics.tsx
+++ b/app/home/[account]/_components/team-account-statistics.tsx
@@ -1,73 +1,31 @@
'use client';
-import { use, useMemo, useState } from 'react';
-
import { redirect } from 'next/navigation';
import { Database } from '@/packages/supabase/src/database.types';
-import {
- ArrowDown,
- ArrowUp,
- ChevronRight,
- Euro,
- Menu,
- TrendingUp,
- User,
-} from 'lucide-react';
-import {
- Area,
- AreaChart,
- Bar,
- BarChart,
- CartesianGrid,
- Line,
- LineChart,
- XAxis,
-} from 'recharts';
+import { ChevronRight, Euro, User } from 'lucide-react';
-import { Badge } from '@kit/ui/badge';
-import {
- Card,
- CardContent,
- CardDescription,
- CardFooter,
- CardHeader,
- CardTitle,
-} from '@kit/ui/card';
-import {
- ChartConfig,
- ChartContainer,
- ChartTooltip,
- ChartTooltipContent,
-} from '@kit/ui/chart';
-import {
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow,
-} from '@kit/ui/table';
+import { Card } from '@kit/ui/card';
+import { Trans } from '@kit/ui/makerkit/trans';
import pathsConfig from '~/config/paths.config';
import { createPath } from '~/config/team-account-navigation.config';
-import { loadCurrentUserAccount } from '../../(user)/_lib/server/load-user-account';
import TeamAccountBenefitStatistics from './team-account-benefit-statistics';
import TeamAccountHealthDetails from './team-account-health-details';
-interface TeamAccountStatisticsProps {
+export interface TeamAccountStatisticsProps {
teamAccount: Database['medreport']['Tables']['accounts']['Row'];
+ memberParams: Pick<
+ Database['medreport']['Tables']['account_params']['Row'],
+ 'weight' | 'height'
+ >[];
}
export default function TeamAccountStatistics({
teamAccount,
+ memberParams,
}: TeamAccountStatisticsProps) {
- const mrr = useMemo(() => generateDemoData(), []);
- const netRevenue = useMemo(() => generateDemoData(), []);
- const fees = useMemo(() => generateDemoData(), []);
- const newCustomers = useMemo(() => generateDemoData(), []);
-
return (
-
Ettevõtte terviseandmed
+
+
+
-
+
- Halda töötajaid
+
- Lisa, muuda või eemalda töötajaid.
+
@@ -128,10 +88,10 @@ export default function TeamAccountStatistics({
- Halda eelarvet
+
- Vali kuidas soovid eelarvet töötajate vahel jagada.
+
@@ -139,738 +99,3 @@ export default function TeamAccountStatistics({
);
}
-
-function generateDemoData() {
- const today = new Date();
- const formatter = new Intl.DateTimeFormat('en-us', {
- month: 'long',
- year: '2-digit',
- });
-
- const data: { value: string; name: string }[] = [];
-
- for (let n = 8; n > 0; n -= 1) {
- const date = new Date(today.getFullYear(), today.getMonth() - n, 1);
-
- data.push({
- name: formatter.format(date),
- value: (Math.random() * 10).toFixed(1),
- });
- }
-
- const lastValue = data[data.length - 1]?.value;
-
- return [data, lastValue] as [typeof data, string];
-}
-
-function Chart(
- props: React.PropsWithChildren<{ data: { value: string; name: string }[] }>,
-) {
- const chartConfig = {
- desktop: {
- label: 'Desktop',
- color: 'var(--chart-1)',
- },
- mobile: {
- label: 'Mobile',
- color: 'var(--chart-2)',
- },
- } satisfies ChartConfig;
-
- return (
-