"use client";
import { createContext, useContext, ReactNode } from "react";
import { useMotionPreferences } from "@/hooks/motion/useMotionPreferences";

interface MotionContextValue {
  reducedMotion: boolean;
}

const MotionContext = createContext<MotionContextValue>({ reducedMotion: false });

export function MotionProvider({ children }: { children: ReactNode }) {
  const { reducedMotion } = useMotionPreferences();
  return (
    <MotionContext.Provider value={{ reducedMotion }}>
      {children}
    </MotionContext.Provider>
  );
}

export const useMotionContext = () => useContext(MotionContext);
