import React, { FunctionComponent } from 'react'; import tw, { styled } from 'twin.macro'; import MenuIcon from '../icons/MenuIcon'; import Overlay from '../layout/Overlay'; type ModalProps = { isOpen?: boolean; onClose?: () => void; }; export const ModalHeader: FunctionComponent & Omit> = ({ children, onClose, ...restProps }) => (
{children} {onClose && ( )}
); export const ModalBody = styled.div(tw`pt-5`); export const ModalActions = styled.div(tw`pt-5`); const Modal: FunctionComponent & ModalProps> = ({ isOpen = false, onClose, children, ...props }) => { return ( <> {isOpen && (
{children}
)} ); }; export default Modal;