FrozenTooltip.tsx
1 import { ExclamationIcon } from '@heroicons/react/outline'; 2 import { Trans } from '@lingui/macro'; 3 import { Box, SvgIcon } from '@mui/material'; 4 5 import { frozenProposalMap } from '../../utils/marketsAndNetworksConfig'; 6 import { ContentWithTooltip } from '../ContentWithTooltip'; 7 import { Link } from '../primitives/Link'; 8 9 interface FrozenTooltipProps { 10 symbol?: string; 11 currentMarket?: string; 12 } 13 14 export const getFrozenProposalLink = ( 15 symbol: string | undefined, 16 currentMarket: string | undefined 17 ): string => { 18 if (symbol && frozenProposalMap[symbol.toUpperCase() + currentMarket]) { 19 return frozenProposalMap[symbol.toUpperCase() + currentMarket]; 20 } else { 21 return 'https://app.aave.com/governance'; 22 } 23 }; 24 25 export const FrozenTooltip = ({ symbol, currentMarket }: FrozenTooltipProps) => { 26 return ( 27 <ContentWithTooltip 28 tooltipContent={ 29 <Box> 30 <Trans> 31 This asset is frozen due to an Aave Protocol Governance decision.{' '} 32 <Link 33 href={getFrozenProposalLink(symbol, currentMarket)} 34 sx={{ textDecoration: 'underline' }} 35 > 36 <Trans>More details</Trans> 37 </Link> 38 </Trans> 39 </Box> 40 } 41 > 42 <SvgIcon sx={{ fontSize: '20px', color: 'error.main', ml: 2 }}> 43 <ExclamationIcon /> 44 </SvgIcon> 45 </ContentWithTooltip> 46 ); 47 };