"use client";
import { createContext, useContext } from "react";

interface AnimationContextType {
  isAnimate: boolean;
  setIsAnimate: React.Dispatch<React.SetStateAction<boolean>>;
}

const AnimationContext = createContext<AnimationContextType | undefined>(
  undefined,
);

export const useAnimation = () => {
  const context = useContext(AnimationContext);
  if (context === undefined) {
    throw new Error("useAnimation must be used within an AnimationProvider");
  }
  return context;
};

export { AnimationContext };
