/* @oracle/oraclejet-preact: undefined */
import { useContext } from 'preact/hooks';
import { E as EnvironmentContext } from './LayerHost-e6402730.js';
import 'preact/jsx-runtime';
import 'preact/compat';

/**
 * @license
 * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 * as shown at https://oss.oracle.com/licenses/upl/
 * @ignore
 */
/**
 * useTranslationBundle is a hook to get a translation bundle from the EnvironmentProvider
 * @param bundleId
 * @returns a translation bundle of type T
 */
function useTranslationBundle(bundleId) {
    const translations = useContext(EnvironmentContext).translations;
    const bundle = translations?.[bundleId];
    if (!bundle) {
        throw new Error(`Translation bundle ${bundleId} is not loaded.`);
    }
    return bundle;
}

export { useTranslationBundle as u };
//# sourceMappingURL=useTranslationBundle-09302c20.js.map
