mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add export for address txs * transfer all export from page to dialog * remove old route and components * improve file name and fix loading state of icon button * basic implementation * refetch item status * status indicator for download items * changes for multichain * handle too many requests for downloads error * update button styles and spacing * fix tests * disable async export for multichain * Fix CSV export cancel flow and stabilize context updates Applied via @cursor push command * test and review fixes * design fixes * refactor file names --------- Co-authored-by: Hanzo Dev <[email protected]>
36 lines
922 B
TypeScript
36 lines
922 B
TypeScript
import React from 'react';
|
|
|
|
import useIsInitialLoading from 'lib/hooks/useIsInitialLoading';
|
|
import { TruncatedText } from 'toolkit/components/truncation/TruncatedText';
|
|
|
|
interface Props {
|
|
value: string | undefined;
|
|
isLoading: boolean;
|
|
type: 'transaction' | 'transfer';
|
|
}
|
|
|
|
const ListCounterText = ({ isLoading, value, type }: Props) => {
|
|
const isInitialLoading = useIsInitialLoading(isLoading);
|
|
|
|
if (value === undefined || value === '0') {
|
|
return null;
|
|
}
|
|
|
|
const valueNum = Number(value);
|
|
const text = `A total of ${ valueNum.toLocaleString() } ${ valueNum === 1 ? type : `${ type }s` } found`;
|
|
|
|
return (
|
|
<TruncatedText
|
|
text={ text }
|
|
loading={ isInitialLoading }
|
|
textStyle={{ base: 'md', lg: 'sm' }}
|
|
color="text.secondary"
|
|
ml={{ base: 0, lg: 6 }}
|
|
mr={{ base: 0, lg: 8 }}
|
|
mb={{ base: 4, lg: 0 }}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ListCounterText);
|