Files
explore/ui/shared/entities/token/TokenEntityInterchain.tsx

27 lines
656 B
TypeScript

import React from 'react';
import type { ExternalChain } from 'types/externalChains';
import config from 'configs/app';
import type { EntityProps } from './TokenEntity';
import TokenEntity from './TokenEntity';
import TokenEntityExternal from './TokenEntityExternal';
interface Props extends EntityProps {
chain: ExternalChain | undefined;
}
const TokenEntityInterchain = ({ chain, ...props }: Props) => {
const isCurrentChain = chain?.id === config.chain.id;
if (isCurrentChain) {
return <TokenEntity { ...props }/>;
}
return <TokenEntityExternal { ...props } chain={ chain }/>;
};
export default React.memo(TokenEntityInterchain);