mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add prefix to API resources * fix pw tests * refactor config * remove unnecessary prefixes in resource names * fixes * update screenshots
57 lines
1.3 KiB
TypeScript
57 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
|
|
import useApiQuery from 'lib/api/useApiQuery';
|
|
import { ADDRESS_INFO } from 'stubs/address';
|
|
import * as DetailedInfo from 'ui/shared/DetailedInfo/DetailedInfo';
|
|
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
|
|
|
interface Props {
|
|
hash: string;
|
|
}
|
|
|
|
const TokenInstanceCreatorAddress = ({ hash }: Props) => {
|
|
const addressQuery = useApiQuery('general:address', {
|
|
pathParams: { hash },
|
|
queryOptions: {
|
|
enabled: Boolean(hash),
|
|
placeholderData: ADDRESS_INFO,
|
|
},
|
|
});
|
|
|
|
if (addressQuery.isError) {
|
|
return null;
|
|
}
|
|
|
|
if (!addressQuery.data?.creator_address_hash) {
|
|
return null;
|
|
}
|
|
|
|
const creatorAddress = {
|
|
hash: addressQuery.data.creator_address_hash,
|
|
filecoin: {
|
|
robust: addressQuery.data.creator_filecoin_robust_address,
|
|
},
|
|
is_contract: false,
|
|
implementations: null,
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<DetailedInfo.ItemLabel
|
|
hint="Address that deployed this token contract"
|
|
isLoading={ addressQuery.isPlaceholderData }
|
|
>
|
|
Creator
|
|
</DetailedInfo.ItemLabel>
|
|
<DetailedInfo.ItemValue>
|
|
<AddressEntity
|
|
address={ creatorAddress }
|
|
isLoading={ addressQuery.isPlaceholderData }
|
|
/>
|
|
</DetailedInfo.ItemValue>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default TokenInstanceCreatorAddress;
|