2024-03-31 16:58:26 +02:00
|
|
|
import { Token } from '@/types'
|
|
|
|
import styles from './TokenLogo.module.css'
|
2024-05-05 15:17:37 +02:00
|
|
|
import oceanImage from '@/images/ocean.png'
|
|
|
|
import agixImage from '@/images/agix.png'
|
|
|
|
import fetImage from '@/images/fet.png'
|
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
|
|
|
|
: fetImage
|
|
|
|
|
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
|
|
|
|
}
|