/* @flow */ import React, { useState } from 'react' import { Button, Dialog, Flex } from '../../' const useDialog = (visible = false) => { const [opened, setOpened] = useState(visible) const toggle = () => setOpened(!opened) return [opened, toggle] } const DialogSizes = () => { const [smDialogOpened, toggleSmDialog] = useDialog() const [mdDialogOpened, toggleMdDialog] = useDialog() const [lgDialogOpened, toggleLgDialog] = useDialog() /* eslint-disable react/jsx-handler-names */ const dialogs = [ { size: 'sm', text: 'Body on small dialog', title: 'Header on small dialog', toggle: toggleSmDialog, visible: smDialogOpened, }, { size: 'md', text: 'Body on medium dialog', title: 'Header on medium dialog', toggle: toggleMdDialog, visible: mdDialogOpened, }, { size: 'lg', text: 'Body on large dialog', title: 'Header on large dialog', toggle: toggleLgDialog, visible: lgDialogOpened, }, ] return (
{dialogs.map((dialog) => ( {dialog.title} {dialog.text} ))}
) } export default DialogSizes