mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
26 lines
686 B
TypeScript
26 lines
686 B
TypeScript
import { chakra } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import { route } from 'nextjs-routes';
|
|
|
|
import config from 'configs/app';
|
|
|
|
import * as BlockEntity from './BlockEntity';
|
|
|
|
const rollupFeature = config.features.rollup;
|
|
|
|
const BlockEntityL1 = (props: BlockEntity.EntityProps) => {
|
|
if (!rollupFeature.isEnabled) {
|
|
return null;
|
|
}
|
|
|
|
const defaultHref = rollupFeature.parentChain.baseUrl + route({
|
|
pathname: '/block/[height_or_hash]',
|
|
query: { height_or_hash: props.hash ?? String(props.number) },
|
|
});
|
|
|
|
return <BlockEntity.default { ...props } href={ props.href ?? defaultHref } link={{ external: true }}/>;
|
|
};
|
|
|
|
export default chakra(BlockEntityL1);
|