From 650abd8bd226a47842793bdbf50010ed051ff30a Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Fri, 24 Nov 2023 11:34:50 +0200 Subject: [PATCH] feat: add state to table header story --- .../ManagementTableHeader.stories.tsx | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/pages/ValidatorManagement/ManagementTable/ManagementTableHeader.stories.tsx b/src/pages/ValidatorManagement/ManagementTable/ManagementTableHeader.stories.tsx index a98c4f70..c7644790 100644 --- a/src/pages/ValidatorManagement/ManagementTable/ManagementTableHeader.stories.tsx +++ b/src/pages/ValidatorManagement/ManagementTable/ManagementTableHeader.stories.tsx @@ -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 -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 ( + + ) } -export const AllSelectedHeader: Story = { - args: { - validatorsAmount: 4, - isAllSelected: true, - handleSelectAll: () => {}, - }, +Default.args = { + isAllSelected: false, + validatorsAmount: 4, + handleSelectAll: () => {}, }