import { useEffect, useState } from 'react' import { type Meta, type StoryFn, type StoryObj } from '@storybook/react' import { Button } from '~/src/components/Button' import { ButtonGroup } from '~/src/components/ButtonGroup' import { FormControl } from '~/src/components/FormControl' import { FormLabel } from '~/src/components/FormLabel' import { ListItem } from '~/src/components/ListItem' import { Select } from '~/src/components/Select' import { Modal, ModalBody, ModalClose, ModalContent, ModalFooter, ModalHeader, ModalTrigger, } from './Modal' import { type ModalContentProps, type ModalHeaderProps, type ModalProps, } from './Modal.types' type ModalCompositionProps = ModalProps & ModalContentProps & ModalHeaderProps function ModalComposition({ show: showProp = false, showCloseIcon, width, height, title, subtitle, description, titleSize, hidden, preventHideOnOutsideClick, }: ModalCompositionProps) { const [show, setShow] = useState(false) useEffect( function watchShowToChange() { setShow(showProp) }, [showProp] ) return ( setShow(true)} onHide={() => setShow(false)} >