import React from 'react'; import { useGasFeeContext } from '../../../../../contexts/gasFee'; import I18nValue from '../../../../ui/i18n-value'; import { NetworkStabilityTooltip } from '../tooltips'; const GRADIENT_COLORS = [ '#037DD6', '#1876C8', '#2D70BA', '#4369AB', '#57629E', '#6A5D92', '#805683', '#9A4D71', '#B44561', '#C54055', '#D73A49', ]; const determineStatusInfo = (givenNetworkCongestion) => { const networkCongestion = givenNetworkCongestion ?? 0.5; const colorIndex = Math.round(networkCongestion * 10); const color = GRADIENT_COLORS[colorIndex]; const sliderTickValue = colorIndex * 10; if (networkCongestion <= 0.33) { return { statusLabel: 'notBusy', tooltipLabel: 'lowLowercase', color, sliderTickValue, }; } else if (networkCongestion > 0.66) { return { statusLabel: 'busy', tooltipLabel: 'highLowercase', color, sliderTickValue, }; } return { statusLabel: 'stable', tooltipLabel: 'stableLowercase', color, sliderTickValue, }; }; const StatusSlider = () => { const { gasFeeEstimates } = useGasFeeContext(); const statusInfo = determineStatusInfo(gasFeeEstimates.networkCongestion); return (
); }; export default StatusSlider;