index.tsx 332 B

12345678910111213141516171819
  1. import React from 'react';
  2. import Modal from '../Modal';
  3. import { Wrapper } from './styled';
  4. type Props = {
  5. children: React.ReactNode;
  6. open: boolean;
  7. };
  8. const Dialog: React.FC<Props> = ({ children, open }: Props) =>
  9. open ? (
  10. <Modal>
  11. <Wrapper>{children}</Wrapper>
  12. </Modal>
  13. ) : null;
  14. export default Dialog;