'use client'; import { useState } from 'react'; import { redirect } from 'next/navigation'; import { Database } from '@/packages/supabase/src/database.types'; import { format } from 'date-fns'; import { enGB, et } from 'date-fns/locale'; import { CalendarIcon, ChevronRight, Euro, User } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { Card } from '@kit/ui/card'; import { Trans } from '@kit/ui/makerkit/trans'; import { Button } from '@kit/ui/shadcn/button'; import { Calendar, DateRange } from '@kit/ui/shadcn/calendar'; import { Popover, PopoverContent, PopoverTrigger, } from '@kit/ui/shadcn/popover'; import pathsConfig from '~/config/paths.config'; import { createPath } from '~/config/team-account-navigation.config'; import TeamAccountBenefitStatistics from './team-account-benefit-statistics'; import TeamAccountHealthDetails from './team-account-health-details'; export interface TeamAccountStatisticsProps { teamAccount: Database['medreport']['Tables']['accounts']['Row']; memberParams: Pick< Database['medreport']['Tables']['account_params']['Row'], 'weight' | 'height' >[]; bmiThresholds: Omit< Database['medreport']['Tables']['bmi_thresholds']['Row'], 'id' >[]; members: Database['medreport']['Functions']['get_account_members']['Returns']; companyParams: Database['medreport']['Tables']['company_params']['Row']; } export default function TeamAccountStatistics({ teamAccount, memberParams, bmiThresholds, members, companyParams, }: TeamAccountStatisticsProps) { const [date, setDate] = useState({ from: new Date(), to: new Date(), }); const { i18n: { language }, } = useTranslation(); const dateFormatOptions = { locale: language === 'et' ? et : enGB, }; return ( <>

redirect( createPath( pathsConfig.app.accountMembers, teamAccount.slug || '', ), ) } >

redirect( createPath( pathsConfig.app.accountBilling, teamAccount.slug || '', ), ) } >

); }