import clsx from "clsx"; import { Link } from "react-router"; import type { CryptocurrenciesListResponse, SimpleCryptoCurrency } from "~/types/crypto-api"; import { formatPercentage } from "~/utils/format"; function PricingRow({ currency, index }: { currency: SimpleCryptoCurrency; index: number; }) { return ( {index + 1} {`${currency.name}

{currency.name}

{currency.symbol}

${currency.price.toLocaleString()} ${(currency.market_cap / 1_000_000_000).toFixed(1)}B ${(currency.volume_24h / 1_000_000_000).toFixed(1)}B 0 ? "bg-emerald-100 text-emerald-700" : "bg-rose-100 text-rose-700" )} > {formatPercentage(currency.percent_change_24h)} ); } export function PricingTable({ currencies }: { currencies: CryptocurrenciesListResponse["currencies"]; }) { return (
{currencies.map((currency, index) => ( ))}
# Asset Price Market cap Volume (24h) Change (24h)
); }