mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* envs and feature setup * home page layout * cross-chain txs page * cross-chain transfers page * cross-chain transfers on tx page * cross-chain messages on tx page * cross-chain tx page * cross-chain tx details token transfers * stats and counters for lists * migrate to new API version * add swagger * mobile lists * placeholder views on address page * tests * fix adaptive tabs initial state when there is only one tab in the list * tweaks * bug fixes * fix tests * update screenshots * migrate to new api version * add chain label tooltip, copy button to txs in lists and same address highlight * list views on address page * fix tests * fix links to current address in the list views * update tooltips * update tables layout * review fixes * fix spelling * update screenshots * update screenshot
41 lines
951 B
TypeScript
41 lines
951 B
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import useApiQuery from 'lib/api/useApiQuery';
|
|
import { INTERCHAIN_STATS_DAILY } from 'stubs/interchainIndexer';
|
|
import StatsWidget from 'ui/shared/stats/StatsWidget';
|
|
|
|
interface Props {}
|
|
|
|
const TransactionsCrossChainStats = (props: Props) => {
|
|
const { data, isPlaceholderData, isError } = useApiQuery('interchainIndexer:stats_daily', {
|
|
queryOptions: {
|
|
placeholderData: INTERCHAIN_STATS_DAILY,
|
|
},
|
|
});
|
|
|
|
if (isError || !data) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Box
|
|
display="grid"
|
|
gridTemplateColumns="1fr"
|
|
rowGap={ 3 }
|
|
columnGap={ 3 }
|
|
mb={ 6 }
|
|
{ ...props }
|
|
>
|
|
<StatsWidget
|
|
label="Cross-chain txns"
|
|
value={ Number(data.daily_messages).toLocaleString() }
|
|
period="24h"
|
|
isLoading={ isPlaceholderData }
|
|
/>
|
|
</Box>
|
|
);
|
|
};
|
|
|
|
export default React.memo(TransactionsCrossChainStats);
|