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<Array<OneVillageTableRow>>([]); - const [floatingAccountsRows, setFloatingAccountsRows] = React.useState<Array<OneVillageTableRow>>([]); 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<FloatingAccount>): Array<OneVillageTableRow> { - return data.map((row) => { - return { - id: row.id, - family: `${row.firstname} ${row.lastname}`, - language: row.language, - email: row.email, - creationDate: 'À venir', - }; - }); - } return ( <> <Box @@ -159,13 +139,6 @@ const VillageStats = () => { columns={FamiliesWithoutAccountHeaders} titleContent={`À surveiller : comptes non créés (${familiesWithoutAccountRows.length})`} /> - <OneVillageTable - admin={false} - emptyPlaceholder={<p>{noDataFoundMessage}</p>} - data={floatingAccountsRows} - columns={FloatingAccountsHeaders} - titleContent={`À surveiller : comptes flottants (${floatingAccountsRows.length})`} - /> <Box className={styles.classroomStats} sx={{