"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useVaultPageType = exports.useVaultType = void 0;
var vaults_1 = require("../../vaults");
var react_1 = require("react");
var router_1 = require("../router");
var react_router_dom_1 = require("react-router-dom");
var useVaultType = function (chain, vaultAddress) {
    return (0, react_1.useMemo)(function () {
        if (!vaultAddress || !chain)
            return {};
        var vaultType = (0, vaults_1.getVaultType)(chain, vaultAddress);
        return { vaultType: vaultType, vaultAddress: vaultAddress };
    }, [chain, vaultAddress]);
};
exports.useVaultType = useVaultType;
var useVaultPageType = function () {
    var chain = (0, router_1.useChain)();
    var vaultAddress = (0, react_router_dom_1.useParams)().vaultAddress;
    return (0, exports.useVaultType)(chain, vaultAddress);
};
exports.useVaultPageType = useVaultPageType;
//# sourceMappingURL=useVaultType.js.map