asi-calculator/features/Prices/Result.tsx

28 lines
536 B
TypeScript
Raw Normal View History

2024-03-29 15:06:40 +01:00
type Props = {
symbol: string
price: number
priceAsi: number
ratio: number
exampleBuyInUsd: number
}
export function Result({
symbol,
price,
priceAsi,
ratio,
exampleBuyInUsd
}: Props) {
return (
<p>
<span>{symbol}</span> You will get {exampleBuyInUsd / price} {symbol},
convertible to <strong>{(exampleBuyInUsd / price) * ratio} ASI</strong>{' '}
currently worth{' '}
<strong>
${((exampleBuyInUsd / price) * ratio * priceAsi).toFixed(2)}
</strong>
.
</p>
)
}