import { chakra } from '@chakra-ui/react'; import React from 'react'; import { route } from 'nextjs/routes'; import { useMultichainContext } from 'lib/contexts/multichain'; import * as EntityBase from 'ui/shared/entities/base/components'; import { distributeEntityProps } from '../base/utils'; type LinkProps = EntityBase.LinkBaseProps & Partial>; const Link = chakra((props: LinkProps) => { const defaultHref = route( { pathname: '/block/[height_or_hash]', query: { height_or_hash: String(props.number) } }, { chain: props.chain, external: props.external }, ); return ( { props.children } ); }); const Icon = (props: EntityBase.IconBaseProps) => { return ( ); }; type ContentProps = Omit & Pick; const Content = chakra((props: ContentProps) => { return ( ); }); const Container = EntityBase.Container; export interface EntityProps extends EntityBase.EntityBaseProps { number: number; index: number; } const FlashblockEntity = (props: EntityProps) => { const multichainContext = useMultichainContext(); const partsProps = distributeEntityProps(props); const content = ; return ( { props.noLink ? content : { content } } ); }; export default React.memo(chakra(FlashblockEntity)); export { Container, Link, Icon, Content, };