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 changeSearchValue = (value: string) => {
|
||||
|
@ -155,7 +159,9 @@ const ManagementTable = () => {
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{validators.map((validator, index) => (
|
||||
{validators
|
||||
.filter(validator => validator.status === tab)
|
||||
.map((validator, index) => (
|
||||
<tr key={index}>
|
||||
<td>
|
||||
<Checkbox id={index.toString()} variant="outline" />
|
||||
|
|
|
@ -42,7 +42,7 @@ const ManagementTabs = () => {
|
|||
</Stack>
|
||||
{VALIDATOR_TABS.map(tab => (
|
||||
<Tabs.Content key={tab.value} value={tab.value} style={{ marginTop: '8px' }}>
|
||||
<ManagementTable />
|
||||
<ManagementTable tab={tab.value} />
|
||||
</Tabs.Content>
|
||||
))}
|
||||
</Tabs>
|
||||
|
|
Loading…
Reference in New Issue