Files
explore/ui/tx/authorizations/TxAuthorizationsListItem.tsx
tom goriunovandGitHub a76c14cac6 Migrate to the props with consistent full naming in the API for addre… (#2694)
* Migrate to the props with consistent full naming in the API for address hash entity and multiple props for L2-rollups

Fixes #2686

* fix test
2025-04-24 13:13:18 +02:00

39 lines
1.5 KiB
TypeScript

import { HStack } from '@chakra-ui/react';
import React from 'react';
import type { TxAuthorization } from 'types/api/transaction';
import config from 'configs/app';
import { Skeleton } from 'toolkit/chakra/skeleton';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
interface Props extends TxAuthorization {
isLoading?: boolean;
}
const TxAuthorizationsListItem = ({ address_hash: addressHash, authority, chain_id: chainId, nonce, isLoading }: Props) => {
return (
<ListItemMobile rowGap={ 3 } fontSize="sm">
<HStack gap={ 3 } w="100%">
<Skeleton loading={ isLoading } fontWeight={ 500 }>Address</Skeleton>
<AddressEntity address={{ hash: addressHash }} isLoading={ isLoading } noIcon/>
</HStack>
<HStack gap={ 3 } w="100%">
<Skeleton loading={ isLoading } fontWeight={ 500 }>Authority</Skeleton>
<AddressEntity address={{ hash: authority }} isLoading={ isLoading } noIcon/>
</HStack>
<HStack gap={ 3 }>
<Skeleton loading={ isLoading } fontWeight={ 500 }>Chain</Skeleton>
<Skeleton loading={ isLoading } color="text.secondary">{ chainId === Number(config.chain.id) ? 'this' : 'any' }</Skeleton>
</HStack>
<HStack gap={ 3 }>
<Skeleton loading={ isLoading } fontWeight={ 500 }>Nonce</Skeleton>
<Skeleton loading={ isLoading } color="text.secondary">{ nonce }</Skeleton>
</HStack>
</ListItemMobile>
);
};
export default TxAuthorizationsListItem;