mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
26 lines
815 B
TypeScript
26 lines
815 B
TypeScript
import { INTERNAL_TX } from 'stubs/internalTx';
|
|
import { generateListStub } from 'stubs/utils';
|
|
import useQueryWithPages from 'ui/shared/pagination/useQueryWithPages';
|
|
|
|
import type { BlockQuery } from './useBlockQuery';
|
|
|
|
interface Params {
|
|
heightOrHash: string;
|
|
blockQuery: BlockQuery;
|
|
tab: string;
|
|
}
|
|
|
|
export default function useBlockInternalTxsQuery({ heightOrHash, blockQuery, tab }: Params) {
|
|
const apiQuery = useQueryWithPages({
|
|
resourceName: 'general:block_internal_txs',
|
|
pathParams: { height_or_hash: heightOrHash },
|
|
options: {
|
|
enabled: Boolean(tab === 'internal_txs' && !blockQuery.isPlaceholderData),
|
|
placeholderData: generateListStub<'general:block_internal_txs'>(INTERNAL_TX, 10, { next_page_params: null }),
|
|
refetchOnMount: false,
|
|
},
|
|
});
|
|
|
|
return apiQuery;
|
|
}
|