asi-calculator/features/prices/components/MarketData/MarketData.tsx

45 lines
1.0 KiB
TypeScript
Raw Normal View History

2024-03-30 19:27:18 +01:00
'use client'
2024-04-06 23:53:29 +02:00
import { Badge } from '@/components'
import { ratioAgixToAsi, ratioFetToAsi, ratioOceanToAsi } from '@/constants'
import { Price, usePrices } from '@/features/prices'
2024-04-14 12:52:37 +02:00
import styles from './MarketData.module.css'
2024-03-30 19:27:18 +01:00
2024-04-01 14:42:08 +02:00
export function MarketData() {
const { prices } = usePrices()
2024-03-30 19:27:18 +01:00
return (
2024-04-01 14:42:08 +02:00
<ul className={styles.marketData}>
2024-03-30 19:27:18 +01:00
<li>
2024-03-31 15:24:07 +02:00
<p>1 ASI</p>
2024-04-14 12:52:37 +02:00
<Price price={prices.asi} />
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
2024-04-06 23:53:29 +02:00
<Badge>fixed</Badge>
2024-03-31 15:24:07 +02:00
</p>
2024-04-14 12:52:37 +02:00
<Price price={prices.fet} />
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>
2024-04-02 11:57:15 +02:00
1 OCEAN ={' '}
<span title={`${ratioOceanToAsi}`}>{ratioOceanToAsi.toFixed(6)}</span>{' '}
ASI
2024-04-06 23:53:29 +02:00
<Badge>fixed</Badge>
2024-03-31 15:24:07 +02:00
</p>
2024-04-14 12:52:37 +02:00
<Price price={prices.ocean} />
2024-03-30 19:27:18 +01:00
</li>
<li>
2024-03-31 15:24:07 +02:00
<p>
2024-04-02 11:57:15 +02:00
1 AGIX ={' '}
<span title={`${ratioAgixToAsi}`}>{ratioAgixToAsi.toFixed(5)}</span>{' '}
ASI
2024-04-06 23:53:29 +02:00
<Badge>fixed</Badge>
2024-03-31 15:24:07 +02:00
</p>
2024-04-14 12:52:37 +02:00
<Price price={prices.agix} />
2024-03-30 19:27:18 +01:00
</li>
</ul>
)
}