"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDrawerConfiguration = void 0;
const react_1 = require("react");
const useFeature_1 = __importDefault(require("../../featureFlags/useFeature"));
/**
 * Hook that provides drawer configuration functionality with feature flag integration.
 *
 * @returns An object containing the createDrawerConfiguration function
 */
function useDrawerConfiguration() {
    const earnDrawerConfigurationFlag = (0, useFeature_1.default)("ptxEarnDrawerConfiguration");
    const createDrawerConfiguration = (0, react_1.useCallback)((drawerConfiguration, useCase, customUseCaseConfigs) => {
        const config = drawerConfiguration;
        // Default use case configs with earn configuration from feature flag
        const earnAppDrawerConfig = earnDrawerConfigurationFlag?.enabled && earnDrawerConfigurationFlag.params
            ? earnDrawerConfigurationFlag.params
            : {};
        const defaultUseCaseConfigs = {
            earn: earnAppDrawerConfig,
        };
        // Merge with any custom use case configs provided
        const useCaseConfigs = {
            ...defaultUseCaseConfigs,
            ...customUseCaseConfigs,
        };
        const useCaseConfig = useCase ? useCaseConfigs[useCase] : undefined;
        return {
            assets: {
                ...useCaseConfig?.assets,
                ...config?.assets,
            },
            networks: {
                ...useCaseConfig?.networks,
                ...config?.networks,
            },
        };
    }, [earnDrawerConfigurationFlag]);
    return { createDrawerConfiguration };
}
exports.useDrawerConfiguration = useDrawerConfiguration;
//# sourceMappingURL=useDrawerConfiguration.js.map