import React, { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
import { CloseBtn } from '../CloseBtn';
import { Modal } from '../Modal';
import * as S from './PageModal.style';

export const PageModal: React.FunctionComponent<any> = function PageModal(props: any) {
   if (props.modal)
      return (
         <Modal show>
            <S.Modal>
               <div className="close-btn-float">
                  <CloseBtn size={24} />
               </div>
               {props.children}
            </S.Modal>
         </Modal>
      );

   return <S.Container>{props.children}</S.Container>;
};
