diff --git a/src/pages/ValidatorManagement/ManagementTable/ManagementTable.tsx b/src/pages/ValidatorManagement/ManagementTable/ManagementTable.tsx index de8c3cbd..f9395686 100644 --- a/src/pages/ValidatorManagement/ManagementTable/ManagementTable.tsx +++ b/src/pages/ValidatorManagement/ManagementTable/ManagementTable.tsx @@ -1,13 +1,11 @@ -import { Checkbox, Text } from '@status-im/components' -import { OptionsIcon } from '@status-im/icons' import { useEffect, useMemo, useState } from 'react' import { YStack, XStack } from 'tamagui' import { VALIDATORS_DATA, VALIDATOR_TABS_MANAGEMENT } from '../../../constants' -import ValidatorProfile from '../../../components/General/ValidatorProfile' import SearchManagement from './SearchManagement' import DropdownFilter from './DropdownFilter' import ManagementTableHeader from './ManagementTableHeader' +import ManagementTableBody from './ManagementTableBody' import './ManagementTable.css' type ManagementTableProps = { @@ -16,7 +14,7 @@ type ManagementTableProps = { changeSearchValue: (value: string) => void } -type Validator = { +export type Validator = { number: number address: string balance: number @@ -69,60 +67,7 @@ const ManagementTable = ({ tab, searchValue, changeSearchValue }: ManagementTabl - - {filteredValidators.map((validator, index) => ( - - - - - - - - - - - - ))} - {filteredValidators.length === 0 && ( - - - - )} - +
- - - - - - {validator.balance} - - - - {validator.income} - - - - {validator.proposals} - - - - {validator.attestations} - - - - {validator.effectiveness}% - - - - {validator.status} - - - -
- - No validators - -
) diff --git a/src/pages/ValidatorManagement/ManagementTable/ManagementTableBody.tsx b/src/pages/ValidatorManagement/ManagementTable/ManagementTableBody.tsx new file mode 100644 index 00000000..b8427443 --- /dev/null +++ b/src/pages/ValidatorManagement/ManagementTable/ManagementTableBody.tsx @@ -0,0 +1,70 @@ +import { Checkbox, Text } from '@status-im/components' +import { OptionsIcon } from '@status-im/icons' + +import ValidatorProfile from '../../../components/General/ValidatorProfile' +import { Validator } from './ManagementTable' + +type ManagementTableBodyProps = { + filteredValidators: Validator[] +} + +const ManagementTableBody = ({ filteredValidators }: ManagementTableBodyProps) => { + return ( + + {filteredValidators.map((validator, index) => ( + + + + + + + + + + {validator.balance} + + + + + {validator.income} + + + + + {validator.proposals} + + + + + {validator.attestations} + + + + + {validator.effectiveness}% + + + + + {validator.status} + + + + + + + ))} + {filteredValidators.length === 0 && ( + + + + No validators + + + + )} + + ) +} + +export default ManagementTableBody