"use client";
import { useForm } from "react-hook-form";

export interface IHeroStepFields {
  title: string;
  description: string;
  button_text: string;
  button_link: string;
  gif_file: string;
}

const useHeroStepPresenter = (initialData?: IHeroStepFields) => {
  const {
    register,
    handleSubmit,
    formState: { errors },
    getValues,
  } = useForm<IHeroStepFields>({
    defaultValues: initialData,
  });

  const onSubmit = (data: IHeroStepFields) => {
    console.log(data);
  };

  return {
    register,
    handleSubmit,
    errors,
    onSubmit,
    getValues,
  };
};

export default useHeroStepPresenter;
