'use strict';

var tslib_es6 = require('./tslib.es6-2c2ed574.js');
var React = require('react');
var miscGetDynamicHealthTool = require('./miscGetDynamicHealthTool.js');

const useHealthToolsCache = (locale) => {
    const [allTools, setAllTools] = React.useState([]);
    React.useEffect(() => {
        (() => tslib_es6.__awaiter(void 0, void 0, void 0, function* () {
            const allHealthTools = yield miscGetDynamicHealthTool.getDynamicHealthToolWithCache(locale);
            setAllTools(allHealthTools);
        }))();
    }, [miscGetDynamicHealthTool.getDynamicHealthToolWithCache, locale]);
    const getHealthToolLink = React.useCallback((type) => { var _a; return ((_a = allTools.find((tool) => tool.template === type)) === null || _a === void 0 ? void 0 : _a.link) || ''; }, [allTools]);
    return { allTools, getHealthToolLink };
};

exports.useHealthToolsCache = useHealthToolsCache;
