import React from 'react'
import CheckCheckOutmodel, { Regularization } from './CheckCheckOutForm'
import AttendLogs from './AttendLogs'
import Confirmation from './Confirmation'

const AttendanceModel = ({modelConfig,closeModal,handleSubmitForm}) => {

  return (
    <div className={`modal-dialog  modal-md modal-simple ${modelConfig.type === "view" ? "modal-lg":"modal-md"}`} >
    <div className="modal-content">
       <div className="modal-body">
          <button
            type="button"
            className="btn-close"
            data-bs-dismiss="modal"
            aria-label="Close"
            onClick={closeModal}
          ></button>
       <div className="text-center mb-2">
       {(modelConfig?.action === 0 || modelConfig?.action === 1 ||  modelConfig?.action === 2) && (
          <CheckCheckOutmodel modeldata={modelConfig} closeModal={closeModal} handleSubmitForm={handleSubmitForm}  />
       )}
      {/* For view logs */}
       {modelConfig?.action === 6 && (
            <AttendLogs Id={modelConfig?.id} closeModal={closeModal}  />
      )}
      {
        modelConfig?.action === 7 &&(
          <Confirmation closeModal={closeModal} />
        )
      }
       </div>
    </div>
  </div>
</div>
  )
}

AttendanceModel.propTypes = {}

export default AttendanceModel