import isPropValid from '@emotion/is-prop-valid' import { css } from '@emotion/react' import styled from '@emotion/styled' import { ElementType, FC, useRef } from 'react' import { SvgJoyTokenMonochrome16, SvgJoyTokenMonochrome24, SvgJoyTokenMonochrome32, SvgJoyTokenMonochrome48, SvgJoyTokenPrimary16, SvgJoyTokenPrimary24, SvgJoyTokenPrimary32, SvgJoyTokenPrimary48, SvgJoyTokenSilver16, SvgJoyTokenSilver24, SvgJoyTokenSilver32, SvgJoyTokenSilver48, } from '@/assets/icons' import { Tooltip } from '@/components/Tooltip' import { TooltipText } from '@/components/Tooltip/Tooltip.styles' import { atlasConfig } from '@/config' import { cVar } from '@/styles' import { Anchor } from '@/views/global/YppLandingView/YppAuthorizationModal/YppAuthorizationModal.styles' type JoyTokenIconVariant = 'primary' | 'silver' | 'regular' | 'gray' type JoyTokenIconSize = 16 | 24 | 32 | 48 export type JoyTokenIconProps = { variant?: JoyTokenIconVariant size?: JoyTokenIconSize className?: string withoutInformationTooltip?: boolean isNegative?: boolean } const VARIANT_SIZE_COMPONENT_MAPPING: Record> = { primary: { 16: SvgJoyTokenPrimary16, 24: SvgJoyTokenPrimary24, 32: SvgJoyTokenPrimary32, 48: SvgJoyTokenPrimary48, }, silver: { 16: SvgJoyTokenSilver16, 24: SvgJoyTokenSilver24, 32: SvgJoyTokenSilver32, 48: SvgJoyTokenSilver48, }, regular: { 16: SvgJoyTokenMonochrome16, 24: SvgJoyTokenMonochrome24, 32: SvgJoyTokenMonochrome32, 48: SvgJoyTokenMonochrome48, }, gray: { 16: SvgJoyTokenMonochrome16, 24: SvgJoyTokenMonochrome24, 32: SvgJoyTokenMonochrome32, 48: SvgJoyTokenMonochrome48, }, } export const JoyTokenIcon: FC = ({ variant = 'regular', size = 16, className, withoutInformationTooltip, isNegative, }) => { const ref = useRef(null) return ( <>