"use client"; import { createContext, useContext, useState, useCallback, type ReactNode } from "react"; type EntryMutationContextValue = { mutationVersion: number; notifyEntryMutation: () => void; }; const EntryMutationContext = createContext(null); export function EntryMutationProvider({ children }: { children: ReactNode }) { const [mutationVersion, setMutationVersion] = useState(0); const notifyEntryMutation = useCallback(() => { setMutationVersion(prev => prev + 1); }, []); return ( {children} ); } export function useEntryMutation() { const context = useContext(EntryMutationContext); if (!context) throw new Error("useEntryMutation must be used within EntryMutationProvider"); return context; }