import type { CryptocurrencyDetailsResponse } from "~/types/crypto-api"; import { formatPercentage } from "~/utils/format"; export function KeyStats({ currency }: { currency: CryptocurrencyDetailsResponse["currency"]; }) { return (

Key Stats

Basic market data.

Market Cap
${(currency.market_cap / 1_000_000_000).toLocaleString()}B
Volume (24h)
${(currency.volume_24h / 1_000_000_000).toLocaleString()}B
Circulating Supply
{(currency.circulating_supply / 1_000_000).toFixed(1)}M {currency.symbol}
Max Supply
{currency.max_supply ? `${(currency.max_supply / 1_000_000).toFixed(1)}M ${currency.symbol}` : "N/A"}
Percent change (24h)
{formatPercentage(currency.percent_change_24h)}
Percent change (7d)
{formatPercentage(currency.percent_change_7d)}
); }