|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Box, Center, Divider, HStack, Skeleton, Text } from "@chakra-ui/react"; |
|
|
|
import { HStack, Skeleton, Text, Tooltip } from "@chakra-ui/react"; |
|
|
|
import React from "react"; |
|
|
|
import Timestamp from "./Timestamp"; |
|
|
|
import { PriceInfo } from "./Types"; |
|
|
@ -15,28 +15,17 @@ export default function CurrentPrice( |
|
|
|
const { ask, bid, last_updated_at } = priceInfo || {}; |
|
|
|
|
|
|
|
return ( |
|
|
|
<Box shadow={"md"} marginBottom={5} padding={5}> |
|
|
|
<Center><Text fontWeight={"bold"}>Current Price</Text></Center> |
|
|
|
<Tooltip label={<><Text align={"left"}>Updated:</Text><Timestamp timestamp={last_updated_at!} /></>}> |
|
|
|
<HStack> |
|
|
|
<Text align={"left"}>Bid:</Text> |
|
|
|
<Text align={"left"} fontWeight={"bold"}>Bid:</Text> |
|
|
|
<Skeleton isLoaded={bid != null}> |
|
|
|
<Text>{bid} USD</Text> |
|
|
|
</Skeleton> |
|
|
|
</HStack> |
|
|
|
<Divider marginTop={2} marginBottom={2} /> |
|
|
|
<HStack> |
|
|
|
<Text align={"left"}>Ask:</Text> |
|
|
|
<Text align={"left"} fontWeight={"bold"}>Ask:</Text> |
|
|
|
<Skeleton isLoaded={ask != null}> |
|
|
|
<Text>{ask} USD</Text> |
|
|
|
</Skeleton> |
|
|
|
</HStack> |
|
|
|
<Divider marginTop={2} marginBottom={2} /> |
|
|
|
<HStack> |
|
|
|
<Text align={"left"}>Updated:</Text> |
|
|
|
<Skeleton isLoaded={last_updated_at != null}> |
|
|
|
<Timestamp timestamp={last_updated_at!} /> |
|
|
|
</Skeleton> |
|
|
|
</HStack> |
|
|
|
</Box> |
|
|
|
</Tooltip> |
|
|
|
); |
|
|
|
} |
|
|
|