/* eslint-disable no-restricted-imports */
import { useEffect, useState } from 'react'
import { type Meta, type StoryFn } from '@storybook/react'
import { Button } from '~/src/components/Button'
import { ButtonGroup } from '~/src/components/ButtonGroup'
import {
ConfirmModal,
ConfirmModalClose,
ConfirmModalContent,
ConfirmModalFooter,
ConfirmModalHeader,
ConfirmModalTrigger,
} from './ConfirmModal'
import {
type ConfirmModalContentProps,
type ConfirmModalHeaderProps,
type ConfirmModalProps,
} from './ConfirmModal.types'
type ConfirmModalCompositionProps = ConfirmModalProps &
ConfirmModalContentProps &
ConfirmModalHeaderProps
function ConfirmModalComposition({
show: showProp = false,
width,
height,
title,
description,
}: ConfirmModalCompositionProps) {
const [show, setShow] = useState(false)
useEffect(
function watchShowToChange() {
setShow(showProp)
},
[showProp]
)
return (
setShow(true)}
onHide={() => setShow(false)}
>
}
/>
)
}
const meta: Meta = {
component: ConfirmModalComposition,
argTypes: {
width: {
control: {
type: 'text',
},
},
height: {
control: {
type: 'text',
},
},
},
}
export default meta
const Template: StoryFn = ConfirmModalComposition
export const Composition = {
render: Template,
args: {
show: false,
title: 'Are you absolutely sure?',
description:
'This action cannot be undone. This will permanently delete your account and remove your data from our servers.',
},
}