mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-23 08:38:11 +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 type { Meta, StoryObj } from '@storybook/react'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
import ManagementTableHeader from './ManagementTableHeader'
|
import ManagementTableHeader from './ManagementTableHeader'
|
||||||
|
|
||||||
@ -14,18 +15,24 @@ const meta = {
|
|||||||
export default meta
|
export default meta
|
||||||
type Story = StoryObj<typeof meta>
|
type Story = StoryObj<typeof meta>
|
||||||
|
|
||||||
export const Default: Story = {
|
export const Default: Story = () => {
|
||||||
args: {
|
const [isAllSelected, setIsAllSelected] = useState(false)
|
||||||
validatorsAmount: 4,
|
|
||||||
isAllSelected: false,
|
const handleSelectAll = () => {
|
||||||
handleSelectAll: () => {},
|
setIsAllSelected(state => !state)
|
||||||
},
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ManagementTableHeader
|
||||||
|
validatorsAmount={4}
|
||||||
|
isAllSelected={isAllSelected}
|
||||||
|
handleSelectAll={handleSelectAll}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AllSelectedHeader: Story = {
|
Default.args = {
|
||||||
args: {
|
isAllSelected: false,
|
||||||
validatorsAmount: 4,
|
validatorsAmount: 4,
|
||||||
isAllSelected: true,
|
handleSelectAll: () => {},
|
||||||
handleSelectAll: () => {},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user