mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add EmptyState component to toolkit and use it in the stats page * remove EmptySearchResult component * tweaks * refactor ComingSoon component * fix toolkit build * rollback changes in main preset
65 lines
1.6 KiB
TypeScript
65 lines
1.6 KiB
TypeScript
import { Box, Flex } from '@chakra-ui/react';
|
|
|
|
import type { EssentialDappsChainConfig } from 'types/client/marketplace';
|
|
import type { AllowanceType } from 'types/client/revoke';
|
|
|
|
import DataListDisplay from 'ui/shared/DataListDisplay';
|
|
|
|
import ApprovalsListItem from './ApprovalsListItem';
|
|
import ApprovalsTable from './ApprovalsTable';
|
|
|
|
type Props = {
|
|
selectedChain: EssentialDappsChainConfig | undefined;
|
|
approvals: Array<AllowanceType>;
|
|
isLoading?: boolean;
|
|
isAddressMatch?: boolean;
|
|
hideApproval: (approval: AllowanceType) => void;
|
|
};
|
|
|
|
export default function Approvals({
|
|
selectedChain,
|
|
approvals,
|
|
isLoading,
|
|
isAddressMatch,
|
|
hideApproval,
|
|
}: Props) {
|
|
const content = (
|
|
<>
|
|
<Flex hideFrom="lg" flexDirection="column">
|
|
{ approvals.map((approval, index) => (
|
|
<ApprovalsListItem
|
|
key={ index }
|
|
selectedChain={ selectedChain }
|
|
approval={ approval }
|
|
isLoading={ isLoading }
|
|
isAddressMatch={ isAddressMatch }
|
|
hideApproval={ hideApproval }
|
|
/>
|
|
)) }
|
|
</Flex>
|
|
<Box hideBelow="lg">
|
|
<ApprovalsTable
|
|
selectedChain={ selectedChain }
|
|
approvals={ approvals }
|
|
isLoading={ isLoading }
|
|
isAddressMatch={ isAddressMatch }
|
|
hideApproval={ hideApproval }
|
|
/>
|
|
</Box>
|
|
</>
|
|
);
|
|
|
|
return (
|
|
<DataListDisplay
|
|
itemsNum={ approvals.length }
|
|
isError={ false }
|
|
hasActiveFilters
|
|
emptyStateProps={{
|
|
term: 'approval',
|
|
}}
|
|
>
|
|
{ content }
|
|
</DataListDisplay>
|
|
);
|
|
}
|