Skip to content

Commit

Permalink
Fix members is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Oct 2, 2024
1 parent 0e040b6 commit fe8c18e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/OrganizationSaas/Dashboard/Team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ const useTeamMembers = ({
const TeamList = () => {
const { data, isLoading, isError, error } = useTeamMembers()

const members = data.members

return (
<QueryDataLayout isEmpty={!data.members} isLoading={isLoading} isError={isError} error={error}>
<QueryDataLayout isEmpty={!data?.members} isLoading={isLoading} isError={isError} error={error}>
<Flex display={'column'}>
<Text fontWeight={'bold'}>
<Trans i18nKey={'team.team_members'}>Team members</Trans>
<Badge ml='1' colorScheme='green'>
{members.length}
{data?.members?.length}
</Badge>
</Text>
<TableContainer>
Expand All @@ -75,7 +73,7 @@ const TeamList = () => {
</Tr>
</Thead>
<Tbody>
{members.map((member, i) => {
{data?.members?.map((member, i) => {
return (
<Tr key={i}>
<Td>
Expand Down

0 comments on commit fe8c18e

Please sign in to comment.