From 51d8747ba80c656e239462926b0d21c66e192a08 Mon Sep 17 00:00:00 2001
From: Benjamin Ramet
Date: Thu, 17 Oct 2024 09:10:15 +0200
Subject: [PATCH] Remove floating accounts table since it will be visible in 1n
1Village tab
---
.../dashboard-statistics/VillageStats.tsx | 29 +------------------
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/src/components/admin/dashboard-statistics/VillageStats.tsx b/src/components/admin/dashboard-statistics/VillageStats.tsx
index cd318f11a..0b25a73ae 100644
--- a/src/components/admin/dashboard-statistics/VillageStats.tsx
+++ b/src/components/admin/dashboard-statistics/VillageStats.tsx
@@ -14,7 +14,7 @@ import styles from './styles/charts.module.css';
import { useGetVillagesStats } from 'src/api/statistics/statistics.get';
import { useCountries } from 'src/services/useCountries';
import { useVillages } from 'src/services/useVillages';
-import type { FamiliesWithoutAccount, FloatingAccount, OneVillageTableRow } from 'types/statistics.type';
+import type { FamiliesWithoutAccount, OneVillageTableRow } from 'types/statistics.type';
import type { VillageFilter } from 'types/village.type';
const VillageStats = () => {
@@ -36,13 +36,10 @@ const VillageStats = () => {
}, [selectedCountry]);
const [familiesWithoutAccountRows, setFamiliesWithoutAccountRows] = React.useState>([]);
- const [floatingAccountsRows, setFloatingAccountsRows] = React.useState>([]);
React.useEffect(() => {
if (villagesStats.data?.familiesWithoutAccount) {
setFamiliesWithoutAccountRows([]);
- setFloatingAccountsRows([]);
setFamiliesWithoutAccountRows(createFamiliesWithoutAccountRows(villagesStats.data?.familiesWithoutAccount));
- setFloatingAccountsRows(createFloatingAccountsRows(villagesStats.data?.floatingAccounts));
}
}, [villagesStats.data?.familiesWithoutAccount, villagesStats.data?.floatingAccounts]);
@@ -78,12 +75,6 @@ const VillageStats = () => {
{ key: 'country', label: 'Pays', sortable: true },
{ key: 'creationDate', label: 'Date de création identifiant', sortable: true },
];
- const FloatingAccountsHeaders = [
- { key: 'family', label: 'Nom Prénom Famille', sortable: true },
- { key: 'language', label: 'Langue', sortable: true },
- { key: 'email', label: 'Mail', sortable: true },
- { key: 'creationDate', label: 'Date de création compte', sortable: true },
- ];
function CustomTabPanel(props: TabPanelProps) {
const { children, value, index, ...other } = props;
@@ -109,17 +100,6 @@ const VillageStats = () => {
};
});
}
- function createFloatingAccountsRows(data: Array): Array {
- return data.map((row) => {
- return {
- id: row.id,
- family: `${row.firstname} ${row.lastname}`,
- language: row.language,
- email: row.email,
- creationDate: 'À venir',
- };
- });
- }
return (
<>
{
columns={FamiliesWithoutAccountHeaders}
titleContent={`À surveiller : comptes non créés (${familiesWithoutAccountRows.length})`}
/>
- {noDataFoundMessage}
}
- data={floatingAccountsRows}
- columns={FloatingAccountsHeaders}
- titleContent={`À surveiller : comptes flottants (${floatingAccountsRows.length})`}
- />