import { Col, Row } from "reactstrap";
import React, { useEffect } from "react";
import ValidationField from "../../../Components/ValidationField/ValidationField";
import { useGetAllTeacher } from "../../../api/teacher";
import useFormatDataToSelect from "../../../utils/useFormatDataToSelect";
import { useFormikContext } from "formik";
import { useModalState } from "../../../zustand/Modal";
import useSearchQuery from "../../../api/utils/useSearchQuery";

const Form = () => {
  const { isOpen } = useModalState((state) => state);
  const formik = useFormikContext<any>();
  useEffect(() => {
    if (isOpen === "") {
      formik.setErrors({});
      formik.resetForm();
    }
  }, [isOpen]);

  return (
    <Row className="w-100">
      <Col>
        <ValidationField name="name" label="name" />
      </Col>
      <Col>
        <ValidationField type="File" name="image" label="image" />
      </Col>
    </Row>
  );
};

export default Form;
