import { useCallback } from "react";
import useFeature from "../../featureFlags/useFeature";
/**
 * Hook that provides drawer configuration functionality with feature flag integration.
 *
 * @returns An object containing the createDrawerConfiguration function
 */
export function useDrawerConfiguration() {
    const earnDrawerConfigurationFlag = useFeature("ptxEarnDrawerConfiguration");
    const createDrawerConfiguration = 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 };
}
//# sourceMappingURL=useDrawerConfiguration.js.map