import { useContext } from "react";
import { UnsavedWarnContext } from "./WarnAboutChangeContext";

export const useWarnAboutChange = () => {
  const context = useContext(UnsavedWarnContext);
  if (context === null)
    throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");

  return context;
};
