"use client";
import { useEffect } from "react";

/**
 * Bridges a step form's reactive `isValid` state up to the parent stepper.
 * Shared across every step presenter so the reporting logic lives in one place.
 */
const useReportStepValidity = (
  isValid: boolean,
  onValidityChange?: (valid: boolean) => void,
) => {
  useEffect(() => {
    onValidityChange?.(isValid);
  }, [isValid, onValidityChange]);
};

export default useReportStepValidity;
