2024-03-30 19:27:18 +01:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
import { ratioOceanToAsi, ratioAgixToAsi, ratioFetToAsi } from '@/constants'
|
|
|
|
import styles from './CalculationBase.module.css'
|
|
|
|
import { usePrices } from '@/hooks'
|
2024-03-31 16:48:31 +02:00
|
|
|
import { Label } from '@/components/Label'
|
2024-03-30 19:27:18 +01:00
|
|
|
|
|
|
|
export function CalculationBase() {
|
2024-04-01 02:15:51 +02:00
|
|
|
const { prices, isValidating, isLoading } = usePrices()
|
|
|
|
|
|
|
|
const feedbackClasses = isLoading
|
|
|
|
? 'isLoading'
|
|
|
|
: isValidating
|
|
|
|
? 'isValidating'
|
|
|
|
: ''
|
2024-03-30 19:27:18 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<ul className={styles.calculationBase}>
|
|
|
|
<li>
|
2024-03-31 15:24:07 +02:00
|
|
|
<p>1 ASI</p>
|
2024-04-01 02:15:51 +02:00
|
|
|
<p>
|
2024-04-01 04:38:59 +02:00
|
|
|
<span className={`${styles.fiat} ${feedbackClasses}`}>
|
|
|
|
${prices.asi}
|
|
|
|
</span>
|
2024-04-01 02:15:51 +02:00
|
|
|
</p>
|
2024-03-30 19:27:18 +01:00
|
|
|
</li>
|
2024-03-30 23:10:36 +01:00
|
|
|
<li>
|
2024-03-31 15:24:07 +02:00
|
|
|
<p>
|
|
|
|
1 Fet = {ratioFetToAsi} ASI
|
|
|
|
<Label>fixed</Label>
|
|
|
|
</p>
|
2024-04-01 02:15:51 +02:00
|
|
|
<p>
|
2024-04-01 04:38:59 +02:00
|
|
|
<span className={`${styles.fiat} ${feedbackClasses}`}>
|
|
|
|
${prices.fet}
|
|
|
|
</span>
|
2024-04-01 02:15:51 +02:00
|
|
|
</p>
|
2024-03-30 23:10:36 +01:00
|
|
|
</li>
|
2024-03-30 19:27:18 +01:00
|
|
|
<li>
|
2024-03-31 15:24:07 +02:00
|
|
|
<p>
|
|
|
|
1 OCEAN = {ratioOceanToAsi} ASI
|
|
|
|
<Label>fixed</Label>
|
|
|
|
</p>
|
2024-04-01 02:15:51 +02:00
|
|
|
<p>
|
2024-04-01 04:38:59 +02:00
|
|
|
<span className={`${styles.fiat} ${feedbackClasses}`}>
|
|
|
|
${prices.ocean}
|
|
|
|
</span>
|
2024-04-01 02:15:51 +02:00
|
|
|
</p>
|
2024-03-30 19:27:18 +01:00
|
|
|
</li>
|
|
|
|
<li>
|
2024-03-31 15:24:07 +02:00
|
|
|
<p>
|
|
|
|
1 AGIX = {ratioAgixToAsi} ASI
|
|
|
|
<Label>fixed</Label>
|
|
|
|
</p>
|
2024-04-01 02:15:51 +02:00
|
|
|
<p>
|
2024-04-01 04:38:59 +02:00
|
|
|
<span className={`${styles.fiat} ${feedbackClasses}`}>
|
|
|
|
${prices.agix}
|
|
|
|
</span>
|
2024-04-01 02:15:51 +02:00
|
|
|
</p>
|
2024-03-30 19:27:18 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
)
|
|
|
|
}
|