From 49784489cd280b2b3906aaeb590b1abf0624b60e Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Mon, 4 Nov 2024 14:47:00 +0100 Subject: [PATCH] chore: do an explicit map instead --- .../ProjectStatus/ProjectResources.tsx | 86 +++++++++---------- 1 file changed, 41 insertions(+), 45 deletions(-) diff --git a/frontend/src/component/project/Project/ProjectStatus/ProjectResources.tsx b/frontend/src/component/project/Project/ProjectStatus/ProjectResources.tsx index de433a1251c8..ef4723ea51cc 100644 --- a/frontend/src/component/project/Project/ProjectStatus/ProjectResources.tsx +++ b/frontend/src/component/project/Project/ProjectStatus/ProjectResources.tsx @@ -3,7 +3,7 @@ import { useProjectApiTokens } from 'hooks/api/getters/useProjectApiTokens/usePr import useProjectOverview from 'hooks/api/getters/useProjectOverview/useProjectOverview'; import { useSegments } from 'hooks/api/getters/useSegments/useSegments'; import { useRequiredPathParam } from 'hooks/useRequiredPathParam'; -import { type ReactNode, useMemo, type FC } from 'react'; +import { useMemo } from 'react'; import UsersIcon from '@mui/icons-material/Group'; import { Link } from 'react-router-dom'; import ApiKeyIcon from '@mui/icons-material/Key'; @@ -73,21 +73,6 @@ const ResourceList = styled('ul')(({ theme }) => ({ }), })); -const ListItem: FC<{ - text: string; - linkUrl: string; - linkText: string; - icon: ReactNode; -}> = ({ text, linkUrl, linkText, icon }) => ( - - - {icon} - {text} - - {linkText} - -); - export const ProjectResources = () => { const projectId = useRequiredPathParam('projectId'); const { project, loading: loadingProject } = useProjectOverview(projectId); @@ -102,41 +87,52 @@ export const ProjectResources = () => { [segments, projectId], ); + const listItems = [ + [ + , + `${project.members} project member(s)`, + + Add members + , + ], + [ + , + `${tokens.length} API key(s)`, + + Add new key + , + ], + [ + , + '1 connected environment(s)', + + View connections + , + ], + [ + , + `${segmentCount} project segment(s)`, + + Add segments + , + ], + ].map(([icon, text, link]) => ( + + + {icon} + {text} + + {link} + + )); + return ( Project Resources - - } - /> - - } - /> - - } - /> - - } - /> - + {listItems} );