import { Modal, type ModalProps } from 'antd';
import React from 'react';

const CommonModal: React.FC<ModalProps> = (props) => {
  const { children } = props;
  return (
    <Modal
      {...props}
      width={'70vw'}
      styles={{
        body: {
          height: '65vh',
          overflowY: 'auto',
          padding: '0 16px',
          minWidth: '100%',
        },
        content: {
          background: '#f5f5f5',
          padding: 0,
        },
        header: {
          padding: '16px 24px',
          marginBottom: 16,
        },
        footer: {
          padding: '16px 24px',
          background: '#ffff',
        },
      }}
    >
      {children}
    </Modal>
  );
};

export default React.memo(CommonModal);
