HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/propbase/propbase_website/shared/common/Modal.tsx
import React from 'react';
import { Modal } from 'react-bootstrap';

interface CustomModalProps {
  className?: string;
  dialgName?: string;
  show: boolean;
  closeModal: () => void;
  body?: React.ReactNode;
  footer?: React.ReactNode;
  header?: React.ReactNode;
  bodyClassname?: string;
  createModal?: boolean;
  disableCenter?: boolean;
}

const CustomModal: React.FC<CustomModalProps> = ({
  className = '',
  dialgName = '',
  show,
  closeModal,
  body = '',
  footer = '',
  header = '',
  bodyClassname = '',
  createModal = false,
  disableCenter = true,
}) => {
  return (
    <Modal
      className={className}
      dialogClassName={dialgName}
      show={show}
      onHide={closeModal}
      backdrop="static"
      centered={!disableCenter}
    >
      <Modal.Header>{header || null}</Modal.Header>
      {createModal ? <Modal.Body className={bodyClassname}>{body}</Modal.Body> : body}
      {footer || null}
    </Modal>
  );
};

export default CustomModal;