import React from 'react';

//Graveyard ecosystem logos
import unicornLogo from '../../assets/img/unicorn.png';
import wings from '../../assets/img/gshare.png';
import magicbondLogo from '../../assets/img/magicbond.png';
import WCRO from '../../assets/img/wcro.png';
import wavax from '../../assets/img/wavax.png';
import usdc from '../../assets/img/USDC.png';
import USDT from '../../assets/img/USDT.png';
import HKN from '../../assets/img/hkn.png';
import MMF from '../../assets/img/mmf.png';
import MINE from '../../assets/img/mine.png';
import unicornWings from '../../assets/img/unicorn-wings.png';
import unicornWcroLpLogo from '../../assets/img/unicorn-wcro.png';
import unicornusdclpLogo from '../../assets/img/unicorn-usdc.png';
import wingsUsdcLpLogo from '../../assets/img/wings-usdc.png';
import wingsWcroLpLogo from '../../assets/img/gshare-wcro.png';
import wamp from '../../assets/img/WAMP.png';
import hsharewings from '../../assets/img/hshare-wings.png';
import gnode from '../../assets/img/gnode.png';
import unicornwlrs from '../../assets/img/unicorn-wlrs.png';
import wingsPops from '../../assets/img/wings-pops.png';

const logosBySymbol: {[title: string]: string} = {
  //Real tokens
  //=====================
  UNICORN: unicornLogo,
  WAVAX: wavax,
  WINGS: wings,
  MAGICBOND: magicbondLogo,
  WCRO: WCRO,
  WAMP: wamp,
  USDC: usdc,
  USDT: USDT,
  HKN: HKN,
  MMF: MMF,
  MINE: MINE,
  HSHARE: wamp,
  GNODE: gnode,
  'UNICORN-WCRO-LP': unicornWcroLpLogo,
  'UNICORN-WCRO-SW': unicornWcroLpLogo,
  'UNICORN-WLRS-LP': unicornwlrs,
  'UNICORN-WINGS-LP': unicornWings,
  'WINGS-WCRO-LP': wingsWcroLpLogo,
  'WINGS-USDC-LP': wingsUsdcLpLogo,
  'UNICORN-USDC-LP': unicornusdclpLogo,
  'HSHARE-WINGS-LP': hsharewings,
  'WINGS-POPS-LP': wingsPops,
};

type LogoProps = {
  symbol: string;
  width?: number;
  height?: number;
};

const TokenSymbol: React.FC<LogoProps> = ({symbol, width, height}) => {
  if (!logosBySymbol[symbol]) {
    throw new Error(`Invalid Token Logo symbol: ${symbol}`);
  }
  if (!width) {
    width = 60;
  }
  if (!height) {
    height = 60;
  }

  return <img src={logosBySymbol[symbol]} alt={`${symbol} Logo`} width={width} height={height} />;
};

export default TokenSymbol;
