Files
tom goriunovandGitHub 4335faeb35 UI/UX: Implement unified EmptyState component for stats page (#3195)
* 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
2025-12-23 11:34:33 +01:00

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>
);
}