
document.addEventListener("DOMContentLoaded", function() {  

// console.log("orphicConstants: ", window.ConstBlockOrphicOptionName);
// console.log("orphicConstantValues: ", window.ConstBlockOrphicOptionValue);
// console.log("orphicWPBlockOptions: ", window.OrphicWPBlockOptions);

// Create a React hook
function useOrphicBlockOptions() {
    const getValue = (key) => {
        return window.OrphicWPBlockOptions[key];
    };

    return { getValue };
}

function useOrphicBlockConstants() {
    const getConstBlockOrphicOptionName = () => {
        return window.ConstBlockOrphicOptionName;
    };
    const getConstBlockOrphicOptionValue = () => {
        return window.ConstBlockOrphicOptionValue;
    };

    return { CONST_BLOCK_OPHIC_OPTION_NAME: getConstBlockOrphicOptionName(), CONST_BLOCK_OPHIC_OPTION_VALUE: getConstBlockOrphicOptionValue() };
}

// Make the hook available globally
window.useOrphicBlockOptions = useOrphicBlockOptions;
window.useOrphicBlockConstants = useOrphicBlockConstants;
});
