import { Col, Row } from "reactstrap";
import ValidationField from "../../../../../../Components/ValidationField/ValidationField";
import { useFormikContext } from "formik";
import { useModalState } from "../../../../../../zustand/Modal";
import { useEffect } from "react";

import { notes } from "../../../../../../types/App";
import { useGetAllRegistrationRecord } from "../../../../../../api/registrationRecord";
import registration_recordSelect from "../../../../../../utils/registration_recordSelect";
import { useParams } from "react-router-dom";

const Form = () => {
  const formik = useFormikContext();
  const { isOpen } = useModalState((state) => state);

  useEffect(() => {
    if (isOpen === "") {
      formik.setErrors({});
      formik.resetForm();
    }
  }, [isOpen]);
  const { edu_class_id } = useParams();

  // console.log(registration_record,"registration_record");

  return (
    <Row className="w-100">
      <Col>
        <ValidationField placeholder="content" label="content" name="content" />

        <ValidationField
          placeholder="date"
          label="date"
          type="Date"
          name="date"
        />
      </Col>

      <Col>
        <ValidationField
          placeholder="type"
          label="type"
          type="Select"
          option={notes}
          name="type"
        />

        <ValidationField
          placeholder="attachments"
          label="attachments"
          type="MaltyFile"
          name="attachments"
        />
      </Col>
    </Row>
  );
};

export default Form;
