mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
27 lines
656 B
TypeScript
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);
|