fix: works with new constant structure

This commit is contained in:
RadoslavDimchev 2023-11-14 00:57:01 +02:00
parent c669a54220
commit a246d109e2
1 changed files with 6 additions and 30 deletions

View File

@ -1,48 +1,24 @@
import { useMemo } from 'react'
import { Tabs } from '@status-im/components'
import { Stack } from 'tamagui'
import ManagementTable from './ManagementTable/ManagementTable'
import { VALIDATOR_TABS } from '../../constants'
const ManagementTabs = () => {
const VALIDATOR_TABS = useMemo(
() => [
{
value: 'Active',
},
{
value: 'Pending',
},
{
value: 'Inactive',
},
{
value: 'Exited',
},
{
value: 'Withdraw',
},
{
value: 'All',
},
],
[],
)
return (
<Tabs defaultValue={VALIDATOR_TABS[0].value}>
<Tabs defaultValue={VALIDATOR_TABS[0]}>
<Stack style={{ cursor: 'pointer', width: 'fit-content', margin: '16px 0' }}>
<Tabs.List size={32}>
{VALIDATOR_TABS.map(tab => (
<Tabs.Trigger key={tab.value} type="default" value={tab.value}>
{tab.value}
<Tabs.Trigger key={tab} type="default" value={tab}>
{tab}
</Tabs.Trigger>
))}
</Tabs.List>
</Stack>
{VALIDATOR_TABS.map(tab => (
<Tabs.Content key={tab.value} value={tab.value} style={{ marginTop: '8px' }}>
<ManagementTable tab={tab.value} />
<Tabs.Content key={tab} value={tab} style={{ marginTop: '8px' }}>
<ManagementTable tab={tab} />
</Tabs.Content>
))}
</Tabs>