asi-calculator/components/TokenLogo/TokenLogo.tsx

23 lines
469 B
TypeScript
Raw Normal View History

2024-03-31 16:58:26 +02:00
import { Token } from '@/types'
import Image from 'next/image'
import styles from './TokenLogo.module.css'
export function TokenLogo({
token,
size = 24
}: {
token: Token | undefined
size?: number
}) {
return token ? (
<span className={styles.logo} data-symbol={token.symbol}>
<Image
src={`https://tokens.1inch.io/${token.address}.png`}
width={size}
height={size}
alt={token.symbol}
/>
</span>
) : null
}