'use client'; import { useMemo } from 'react'; import { cn } from '../../styles/theme'; import type { TokenImageProps } from '../types'; import { getTokenImageColor } from '../utils/getTokenImageColor'; export function TokenImage({ className, size = 24, token }: TokenImageProps) { const { image, name } = token; const styles = useMemo(() => { return { image: { width: `${size}px`, height: `${size}px`, minWidth: `${size}px`, minHeight: `${size}px`, }, placeholderImage: { background: getTokenImageColor(name), width: `${size}px`, height: `${size}px`, minWidth: `${size}px`, minHeight: `${size}px`, }, }; }, [size, name]); if (!image) { return (