Files
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

28 lines
651 B
TypeScript

import { chakra } from '@chakra-ui/react';
import React from 'react';
import { route } from 'nextjs-routes';
import config from 'configs/app';
import * as TokenEntity from './TokenEntity';
const rollupFeature = config.features.rollup;
const TokenEntityL1 = (props: TokenEntity.EntityProps) => {
if (!rollupFeature.isEnabled) {
return null;
}
const defaultHref = rollupFeature.parentChain.baseUrl + route({
pathname: '/token/[hash]',
query: { hash: props.token.address_hash },
});
return (
<TokenEntity.default { ...props } href={ props.href ?? defaultHref } isExternal/>
);
};
export default chakra(TokenEntityL1);