feat: add state to table story for dynamic
This commit is contained in:
parent
6517d9db55
commit
e393e60154
|
@ -1,24 +0,0 @@
|
|||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
|
||||
import ManagementTable from './ManagementTable'
|
||||
import { VALIDATOR_TABS } from '../../../constants'
|
||||
|
||||
const meta = {
|
||||
title: 'ValidatorManagement/ManagementTable',
|
||||
component: ManagementTable,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
} satisfies Meta<typeof ManagementTable>
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
tab: VALIDATOR_TABS[0],
|
||||
searchValue: '',
|
||||
changeSearchValue: () => {},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
import type { Meta, StoryObj } from '@storybook/react'
|
||||
|
||||
import ManagementTable from './ManagementTable'
|
||||
import { VALIDATOR_TABS } from '../../../constants'
|
||||
import { useState } from 'react'
|
||||
|
||||
const meta = {
|
||||
title: 'ValidatorManagement/ManagementTable',
|
||||
component: ManagementTable,
|
||||
parameters: {
|
||||
layout: 'centered',
|
||||
},
|
||||
tags: ['autodocs'],
|
||||
} satisfies Meta<typeof ManagementTable>
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
export const Default: Story = () => {
|
||||
const [searchValue, setSearchValue] = useState('')
|
||||
|
||||
const changeSearchValue = (os: string) => {
|
||||
setSearchValue(os)
|
||||
}
|
||||
|
||||
return (
|
||||
<ManagementTable
|
||||
tab={VALIDATOR_TABS[0]}
|
||||
searchValue={searchValue}
|
||||
changeSearchValue={changeSearchValue}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Default.args = {
|
||||
tab: VALIDATOR_TABS[0],
|
||||
searchValue: '',
|
||||
changeSearchValue: () => {},
|
||||
}
|
Loading…
Reference in New Issue