import { marketPrices } from '@/data/market' const prices = marketPrices.slice(0, 4) export default function SnapshotBar() { return (
{prices.map((price, idx) => { const isLast = idx === prices.length - 1 const isUp = price.trend === 'up' const isDown = price.trend === 'down' const arrow = isUp ? '↑' : isDown ? '↓' : '—' const changeColor = isUp ? 'var(--green-ink)' : isDown ? 'var(--red)' : 'var(--ink-4)' return (
{/* Label */}
{price.name}
{/* Value */}
{price.value.toLocaleString('fa-IR')}
{/* Change row */}
{arrow}{' '} {Math.abs(price.changePercent).toLocaleString('fa-IR', { minimumFractionDigits: 1, maximumFractionDigits: 1, })} ٪ {price.unit}
) })}
) }