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

interface FooterFormValues {
  email: string;
  phone: string;
  location: string;
  tagline: string;
  copyright: string;
}

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

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

  const collectData = async () => {
    return getValues();
  };

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

export default useFooterStepPresenter;
