import type { Story, Meta } from '@storybook/react'; import { useState } from 'react'; import DialogContentText from '@mui/material/DialogContentText'; import { ASSETS_URL } from '../../../consts/common'; import { Button } from '../../button'; import { Link } from '../../@navigation/link'; import { Modal } from './modal'; import type { ModalProps } from './modal'; export default { component: Modal, title: 'Pop Overs/Modal', argTypes: { onClose: { description: 'Callback to be fired on close icon click.' }, dialogTitleProps: { description: 'Properties for perimeter_81 `DialogTitle` component.' }, dialogContentProps: { description: 'Properties for material-ui `DialogContent` component.' }, dialogActionsProps: { description: 'Properties for material-ui `DialogActions` component.' } } } as Meta; const Template: Story = args => { const [open, setOpen] = useState(false); const handleOpen = () => { setOpen(true); }; const handleClose = () => { setOpen(false); }; return ( <> ); }; export const NoIcon = Template.bind({}); NoIcon.args = { onClose: () => alert('Will close dialog.'), dialogTitleProps: { children: 'Dialog title' }, dialogContentProps: { children: ( Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vitae gravida lorem. In non gravida elit. Sed fringilla nunc id metus aliquam laoreet. ) }, dialogActionsProps: { children: ( ) } }; const ModalTemplate: Story = () => { const [open, setOpen] = useState(false); const handleClickOpen = () => { setOpen(true); }; const handleClose = () => { setOpen(false); }; const handleAgreeAndClose = () => { alert('The user has confirmed his consent.'); setOpen(false); }; return ( <> Are you sure you want to reset Database 2FA{' '} Keanu Cook ? ) }} dialogActionsProps={{ children: ( <> ) }} /> ); }; export const WithIcon = ModalTemplate.bind({}); const ModalTemplateWithAvatar: Story = () => { const [open, setOpen] = useState(false); const handleClickOpen = () => { setOpen(true); }; const handleClose = () => { setOpen(false); }; const handleAgreeAndClose = () => { alert('The user has confirmed his consent.'); setOpen(false); }; return ( <> Are you sure you want to reset Database 2FA{' '} Keanu Cook ? ) }} dialogActionsProps={{ children: ( <> ) }} /> ); }; export const WithAvatar = ModalTemplateWithAvatar.bind({}); export const Video: Story = () => { const [open, setOpen] = useState(false); const handleClickOpen = () => { setOpen(true); }; const handleClose = () => { setOpen(false); }; return ( <> ); };