"use client";

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

const useAgentForm = () => {
  const [triggerAlert, setTriggerAlert] = useState(false);

  const {
    register,
    handleSubmit,
    watch,
    formState: { errors },
  } = useForm();

  const onSubmit = (data) => {
    setTriggerAlert(true);
    console.log("Submitted data:", data);
  };

  return {
    register,
    handleSubmit,
    watch,
    errors,
    onSubmit,
    triggerAlert,
    setTriggerAlert,
  };
};

export default useAgentForm;
