import Modal from 'react-bootstrap/Modal';
import Button from 'react-bootstrap/Button';

interface DeleteFacultyModalProps {
  show: boolean;
  handleClose: () => void;
  title: string;
  userName: string;
  isInstructor: boolean;
  onPrimaryAction: () => void;
}

const DeleteFacultyModal: React.FC<DeleteFacultyModalProps> = ({
  show,
  handleClose,
  title,
  userName,
  isInstructor,
  onPrimaryAction,
}) => {
  return (
    <Modal show={show} onHide={handleClose}>
      <Modal.Header closeButton>
        <Modal.Title>{title}</Modal.Title>
      </Modal.Header>
      <Modal.Body>
        Are you sure you want to remove <b>{userName}</b> from the roster?{' '}
        {isInstructor
          ? 'Their orders will automatically be re-assigned to the course administrator. '
          : ''}
        <span className='text-danger'>
          <b>Warning:</b> This action is irreversible.
        </span>
      </Modal.Body>
      <Modal.Footer>
        <Button variant='secondary' onClick={handleClose}>
          Close
        </Button>
        <Button variant='danger' onClick={onPrimaryAction}>
          Delete User
        </Button>
      </Modal.Footer>
    </Modal>
  );
};

export default DeleteFacultyModal;
