import { useContext } from "react";
import { DialogStateContext, DialogStateContextValue } from "./DialogStateProvider";

export function useDialogState() : DialogStateContextValue {
    const context = useContext(DialogStateContext);
    if(!context){
        throw new Error("useDialogState must be used within a DialogStateProvider");
    }

    return context;
}