mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-28 02:50:45 +00:00
feat: add filter by tabs for table
This commit is contained in:
parent
9daa0ec2b6
commit
1d242c6e86
@ -58,7 +58,11 @@ const validators = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const ManagementTable = () => {
|
type ManagementTableProps = {
|
||||||
|
tab: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const ManagementTable = ({ tab }: ManagementTableProps) => {
|
||||||
const [searchValue, setSearchValue] = useState('')
|
const [searchValue, setSearchValue] = useState('')
|
||||||
|
|
||||||
const changeSearchValue = (value: string) => {
|
const changeSearchValue = (value: string) => {
|
||||||
@ -155,7 +159,9 @@ const ManagementTable = () => {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{validators.map((validator, index) => (
|
{validators
|
||||||
|
.filter(validator => validator.status === tab)
|
||||||
|
.map((validator, index) => (
|
||||||
<tr key={index}>
|
<tr key={index}>
|
||||||
<td>
|
<td>
|
||||||
<Checkbox id={index.toString()} variant="outline" />
|
<Checkbox id={index.toString()} variant="outline" />
|
||||||
|
@ -42,7 +42,7 @@ const ManagementTabs = () => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
{VALIDATOR_TABS.map(tab => (
|
{VALIDATOR_TABS.map(tab => (
|
||||||
<Tabs.Content key={tab.value} value={tab.value} style={{ marginTop: '8px' }}>
|
<Tabs.Content key={tab.value} value={tab.value} style={{ marginTop: '8px' }}>
|
||||||
<ManagementTable />
|
<ManagementTable tab={tab.value} />
|
||||||
</Tabs.Content>
|
</Tabs.Content>
|
||||||
))}
|
))}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user