feat: add filter by tabs for table

This commit is contained in:
RadoslavDimchev 2023-11-14 00:35:41 +02:00
parent 9daa0ec2b6
commit 1d242c6e86
2 changed files with 61 additions and 55 deletions

View File

@ -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" />

View File

@ -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>