Files
explore/ui/txs/TxsWithFrontendSorting.tsx
tom goriunovandGitHub ca4c8d6633 OP Superchain Explorer: MVP (#2786)
* context for storing subchain config and tx view for subchain

* address page and block page for subchain

* address aggregated page: local txs tab

* connect MultichainSelect to context

* home page placeholder

* refactor subchain select state

* envs for demo

* fix ts

* clear value for l2 review

* subchain widgets on home page

* csp policies

* sockets, duck and goose

* fix socket on subchain address page

* link builder for subchain views

* update home widget

* fix time increment

* enable tx interpretator and metadata service

* generate multichain config based on every chain app config

* Fix the multichain config to work in Docker

* multichain socket test

* rename subchain-id to subchain-slug path param

* refactoring

* update chain icons on entities

* home page: latest local txs

* latest cross-chain txs

* minor improvements

* renaming, pt. 1

* rename chain routes

* enable blockchain interaction

* add loading state to icon shield

* fix build

* fix tests

* update types package
2025-07-03 15:07:00 +02:00

57 lines
1.5 KiB
TypeScript

import React from 'react';
import type { TxsSocketType } from './socket/types';
import type { AddressFromToFilter } from 'types/api/address';
import type { QueryWithPagesResult } from 'ui/shared/pagination/useQueryWithPages';
import TxsContent from './TxsContent';
import useTxsSort from './useTxsSort';
type Props = {
query: QueryWithPagesResult<'general:txs_validated' | 'general:txs_pending'> |
QueryWithPagesResult<'general:txs_watchlist'> |
QueryWithPagesResult<'general:block_txs'> |
QueryWithPagesResult<'general:zkevm_l2_txn_batch_txs'>;
showBlockInfo?: boolean;
socketType?: TxsSocketType;
currentAddress?: string;
filter?: React.ReactNode;
filterValue?: AddressFromToFilter;
enableTimeIncrement?: boolean;
top?: number;
};
const TxsWithFrontendSorting = ({
filter,
filterValue,
query,
showBlockInfo = true,
socketType,
currentAddress,
enableTimeIncrement,
top,
}: Props) => {
const { data, isPlaceholderData, isError, setSortByValue, sorting } = useTxsSort(query);
return (
<TxsContent
filter={ filter }
filterValue={ filterValue }
showBlockInfo={ showBlockInfo }
socketType={ socketType }
currentAddress={ currentAddress }
enableTimeIncrement={ enableTimeIncrement }
top={ top }
items={ data?.items }
isPlaceholderData={ isPlaceholderData }
isError={ isError }
setSorting={ setSortByValue }
sort={ sorting }
pagination={ query.pagination }
/>
);
};
export default TxsWithFrontendSorting;