import { TIERS } from '@widgets/currency-converter' import styles from './CommissionPanel.module.css' const ru = (n: number) => n.toLocaleString('ru-RU') interface Props { amount: number progress: number commission: number effectiveRate: number } export function CommissionPanel({ amount, progress, commission, effectiveRate }: Props) { return (
КОМИССИЯ СЕРВИСА
{TIERS.map((tier, i) => (
= tier.min && amount <= tier.max) || undefined} > {ru(tier.min)} – {ru(tier.max)} ₽ {tier.pct}%
))}
Комиссия {commission.toLocaleString('ru-RU', { maximumFractionDigits: 2 })} ₽
Курс с комиссией {effectiveRate.toFixed(2)} ₽
) }