Refactor team account statistics and health details

- Simplified the TeamAccountStatistics component by removing unused code and integrating translation for health details.
- Updated the load-team-account-health-details to calculate average BMI based on member parameters.
- Adjusted the billing page to correctly reference the number of team members.
- Enhanced the main account page to pass member parameters to the Dashboard component.
- Modified the admin account page to destructure member data from the API response.
- Updated the TeamAccountsApi to return member parameters alongside member data.
- Added new translations for health details in Estonian locale.
This commit is contained in:
Danel Kungla
2025-08-18 16:50:26 +03:00
parent 937f3e4a71
commit 2b79a9e401
9 changed files with 189 additions and 861 deletions

View File

@@ -88,35 +88,70 @@ const TeamAccountBenefitStatistics = ({
<div className="grid flex-2 grid-cols-2 gap-2 sm:grid-cols-3 sm:grid-rows-2">
<StatisticsCard>
<StatisticsCardTitle>Analüüsid</StatisticsCardTitle>
<StatisticsCardTitle>
<Trans i18nKey="teams:benefitStatistics.data.analysis" />
</StatisticsCardTitle>
<StatisticsValue>18 %</StatisticsValue>
<StatisticsDescription>36 broneeringut</StatisticsDescription>
<StatisticsDescription>
<Trans
i18nKey="teams:benefitStatistics.data.reservations"
values={{ value: 36 }}
/>
</StatisticsDescription>
</StatisticsCard>
<StatisticsCard>
<StatisticsCardTitle>Eriarstid ja spetsialistid</StatisticsCardTitle>
<StatisticsCardTitle>
<Trans i18nKey="teams:benefitStatistics.data.doctorsAndSpecialists" />
</StatisticsCardTitle>
<StatisticsValue>22 %</StatisticsValue>
<StatisticsDescription>44 broneeringut</StatisticsDescription>
<StatisticsDescription>
<Trans
i18nKey="teams:benefitStatistics.data.reservations"
values={{ value: 44 }}
/>
</StatisticsDescription>
</StatisticsCard>
<StatisticsCard>
<StatisticsCardTitle>Uuringud</StatisticsCardTitle>
<StatisticsCardTitle>
<Trans i18nKey="teams:benefitStatistics.data.researches" />
</StatisticsCardTitle>
<StatisticsValue>20 %</StatisticsValue>
<StatisticsDescription>40 broneeringut</StatisticsDescription>
<StatisticsDescription>
<Trans
i18nKey="teams:benefitStatistics.data.reservations"
values={{ value: 40 }}
/>
</StatisticsDescription>
</StatisticsCard>
<StatisticsCard>
<StatisticsCardTitle>E-konsultatsioon</StatisticsCardTitle>
<StatisticsValue>17 %</StatisticsValue>
<StatisticsDescription>34 broneeringut</StatisticsDescription>
<StatisticsDescription>
<Trans
i18nKey="teams:benefitStatistics.data.reservations"
values={{ value: 34 }}
/>
</StatisticsDescription>
</StatisticsCard>
<Card className="col-span-2 p-4">
<StatisticsCardTitle>Terviseuuringute paketid</StatisticsCardTitle>
<StatisticsCardTitle>
<Trans i18nKey="teams:benefitStatistics.data.healthResearchPlans" />
</StatisticsCardTitle>
<div className="grid grid-cols-2 gap-2">
<div className="border-r">
<StatisticsValue>23 %</StatisticsValue>
<StatisticsDescription>46 teenuse kasutust</StatisticsDescription>
<StatisticsDescription>
<Trans
i18nKey="teams:benefitStatistics.data.serviceUsage"
values={{ value: 46 }}
/>
</StatisticsDescription>
</div>
<div className="ml-4">
<StatisticsValue>1800 </StatisticsValue>
<StatisticsDescription>Teenuste summa</StatisticsDescription>
<StatisticsDescription>
<Trans i18nKey="teams:benefitStatistics.data.serviceSum" />
</StatisticsDescription>
</div>
</div>
</Card>