import { Controller, useWatch } from "react-hook-form";
import FilterBodyField from "./FilterBodyField";

const FilterBodyController = ({ column, control, reset, errors }) => {
  return (
    <Controller
      name={`${column.id}`}
      control={control}
      render={({ field: { value, name, onBlur, onChange } }) => {
        return (
          <FilterBodyField
            column={column}
            filterParameters={value}
            handleChange={onChange}
            handleBlur={onBlur}
            dependencyFieldValue={null}
            resetForm={() => reset()}
            errors={errors}
          />
        );
      }}
    />
  );
};
export default FilterBodyController;
