@ledgerhq/live-common
Version:
Common ground for the Ledger Live apps
25 lines • 926 B
JavaScript
import { useFeature } from "../../featureFlags";
const assetConfigurationDisabled = {
rightElement: "undefined",
leftElement: "undefined",
filter: "undefined",
};
const networkConfigurationDisabled = {
rightElement: "undefined",
leftElement: "undefined",
};
export const useModularDrawerConfiguration = (featureFlagKey, drawerConfiguration) => {
const featureModularDrawer = useFeature(featureFlagKey);
const modularizationEnabled = featureModularDrawer?.params?.enableModularization ?? false;
const assetsConfiguration = modularizationEnabled
? drawerConfiguration?.assets
: assetConfigurationDisabled;
const networkConfiguration = modularizationEnabled
? drawerConfiguration?.networks
: networkConfigurationDisabled;
return {
assetsConfiguration,
networkConfiguration,
};
};
//# sourceMappingURL=useModularDrawerConfiguration.js.map