Files
explore/ui/shared/DataListDisplay.tsx
T
tom goriunovandGitHub 9908a53269 Arbitrum messages claiming (#2533)
* txn withdrawals page stub

* add base page layout

* add ConnectWallet alert

* save search term in page query param

* add links to the new page

* add functionality to claim button

* combine "Connect wallet" and "Claim" buttons

* Refactor rollup configuration to introduce ParentChain structure and deprecate legacy environment variables

* handle txn claim

* allow to pass array of RPC urls for parent chain config

* display token value and completion tx hash

* fix csp

* write tests for arbitrum l2 txn withdrawals

* fix ts

* review fixes

* update screenshots and hide button if the txn is not confirmed yet
2025-02-11 10:36:36 +01:00

56 lines
1.3 KiB
TypeScript

import { Box, Text, chakra } from '@chakra-ui/react';
import React from 'react';
import EmptySearchResult from 'ui/shared/EmptySearchResult';
import DataFetchAlert from './DataFetchAlert';
type FilterProps = {
hasActiveFilters: boolean;
emptyFilteredText: string;
};
type Props = {
isError: boolean;
items?: Array<unknown>;
emptyText?: React.ReactNode;
actionBar?: React.ReactNode;
showActionBarIfEmpty?: boolean;
content: React.ReactNode;
className?: string;
filterProps?: FilterProps;
};
const DataListDisplay = (props: Props) => {
if (props.isError) {
return <DataFetchAlert className={ props.className }/>;
}
if (props.filterProps?.hasActiveFilters && !props.items?.length) {
return (
<Box className={ props.className }>
{ props.actionBar }
<EmptySearchResult text={ props.filterProps.emptyFilteredText }/>
</Box>
);
}
if (!props.items?.length) {
return (
<>
{ props.showActionBarIfEmpty && props.actionBar }
{ props.emptyText && <Text className={ props.className }>{ props.emptyText }</Text> }
</>
);
}
return (
<Box className={ props.className }>
{ props.actionBar }
{ props.content }
</Box>
);
};
export default chakra(DataListDisplay);