import { useContext } from "react";
import { ImageViewerContext } from "./ImageViewerProvider";

export function useImageViewer() {
    const context = useContext(ImageViewerContext);
    if(!context){
        throw new Error("useImageViewer must be used within a ImageViewerProvider");
    }

    return context;
}