mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* add prefix to API resources * fix pw tests * refactor config * remove unnecessary prefixes in resource names * fixes * update screenshots
27 lines
848 B
TypeScript
27 lines
848 B
TypeScript
import { TX } from 'stubs/tx';
|
|
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 useBlockBlobTxsQuery({ heightOrHash, blockQuery, tab }: Params) {
|
|
const apiQuery = useQueryWithPages({
|
|
resourceName: 'general:block_txs',
|
|
pathParams: { height_or_hash: heightOrHash },
|
|
filters: { type: 'blob_transaction' },
|
|
options: {
|
|
enabled: Boolean(tab === 'blob_txs' && !blockQuery.isPlaceholderData && blockQuery.data?.blob_transaction_count),
|
|
placeholderData: generateListStub<'general:block_txs'>(TX, 3, { next_page_params: null }),
|
|
refetchOnMount: false,
|
|
},
|
|
});
|
|
|
|
return apiQuery;
|
|
}
|