mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-23 00:28:19 +00:00
feat: add state to table header story
This commit is contained in:
parent
8c08589927
commit
650abd8bd2
@ -1,4 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
import { useState } from 'react'
|
||||
|
||||
import ManagementTableHeader from './ManagementTableHeader'
|
||||
|
||||
@ -14,18 +15,24 @@ const meta = {
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
validatorsAmount: 4,
|
||||
isAllSelected: false,
|
||||
handleSelectAll: () => {},
|
||||
},
|
||||
export const Default: Story = () => {
|
||||
const [isAllSelected, setIsAllSelected] = useState(false)
|
||||
|
||||
const handleSelectAll = () => {
|
||||
setIsAllSelected(state => !state)
|
||||
}
|
||||
|
||||
return (
|
||||
<ManagementTableHeader
|
||||
validatorsAmount={4}
|
||||
isAllSelected={isAllSelected}
|
||||
handleSelectAll={handleSelectAll}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
export const AllSelectedHeader: Story = {
|
||||
args: {
|
||||
validatorsAmount: 4,
|
||||
isAllSelected: true,
|
||||
handleSelectAll: () => {},
|
||||
},
|
||||
Default.args = {
|
||||
isAllSelected: false,
|
||||
validatorsAmount: 4,
|
||||
handleSelectAll: () => {},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user