2024-05-05 15:17:37 +02:00
|
|
|
import agixImage from '@/images/agix.png'
|
2024-06-10 15:54:58 +02:00
|
|
|
import asiImage from '@/images/asi.png'
|
2024-09-19 22:01:39 +02:00
|
|
|
import cudosImage from '@/images/cudos.png'
|
2024-07-26 14:16:59 +02:00
|
|
|
import fetImage from '@/images/fet.png'
|
|
|
|
import oceanImage from '@/images/ocean.png'
|
|
|
|
import type { Token } from '@/types'
|
|
|
|
import styles from './TokenLogo.module.css'
|
2024-03-31 16:58:26 +02:00
|
|
|
|
|
|
|
export function TokenLogo({
|
|
|
|
token,
|
|
|
|
size = 24
|
|
|
|
}: {
|
|
|
|
token: Token | undefined
|
|
|
|
size?: number
|
|
|
|
}) {
|
2024-05-05 15:17:37 +02:00
|
|
|
const imageSrc =
|
|
|
|
token?.symbol === 'OCEAN'
|
|
|
|
? oceanImage
|
|
|
|
: token?.symbol === 'AGIX'
|
|
|
|
? agixImage
|
2024-06-10 15:54:58 +02:00
|
|
|
: token?.symbol === 'ASI'
|
|
|
|
? asiImage
|
2024-09-19 22:01:39 +02:00
|
|
|
: token?.symbol === 'CUDOS'
|
|
|
|
? cudosImage
|
|
|
|
: fetImage
|
2024-05-05 15:17:37 +02:00
|
|
|
|
2024-03-31 16:58:26 +02:00
|
|
|
return token ? (
|
|
|
|
<span className={styles.logo} data-symbol={token.symbol}>
|
2024-05-05 15:17:37 +02:00
|
|
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
|
|
<img
|
|
|
|
src={imageSrc.src}
|
2024-03-31 16:58:26 +02:00
|
|
|
width={size}
|
|
|
|
height={size}
|
2024-05-05 15:17:37 +02:00
|
|
|
alt={`${token.symbol} Logo`}
|
2024-03-31 16:58:26 +02:00
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
) : null
|
|
|
|
}
|