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

52 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-03-30 19:27:18 +01:00
'use client'
import { ratioOceanToAsi, ratioAgixToAsi, ratioFetToAsi } from '@/constants'
2024-04-01 14:42:08 +02:00
import styles from './MarketData.module.css'
2024-04-01 15:23:01 +02:00
import { usePrices } from '@/features/prices'
2024-04-06 23:53:29 +02:00
import { Badge } from '@/components'
import { Price } from '../Price'
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>
<Price price={prices.asi.usd} priceChange={prices.asi.usd_24h_change} />
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>
<Price price={prices.fet.usd} priceChange={prices.fet.usd_24h_change} />
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>
<Price
price={prices.ocean.usd}
priceChange={prices.ocean.usd_24h_change}
/>
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>
<Price
price={prices.agix.usd}
priceChange={prices.agix.usd_24h_change}
/>
2024-03-30 19:27:18 +01:00
</li>
</ul>
)
}