import { Flex, chakra } from '@chakra-ui/react'; import React from 'react'; import type { Pool } from 'types/api/pools'; import { route } from 'nextjs-routes'; import { getPoolTitle } from 'lib/pools/getPoolTitle'; import { Skeleton } from 'toolkit/chakra/skeleton'; import { TruncatedTextTooltip } from 'toolkit/components/truncation/TruncatedTextTooltip'; import * as EntityBase from 'ui/shared/entities/base/components'; import { distributeEntityProps } from '../base/utils'; import * as TokenEntity from '../token/TokenEntity'; type LinkProps = EntityBase.LinkBaseProps & Pick; const Link = chakra((props: LinkProps) => { const defaultHref = route({ pathname: '/pools/[hash]', query: { hash: props.pool.pool_id } }); return ( { props.children } ); }); type IconProps = Pick & EntityBase.IconBaseProps; const Icon = (props: IconProps) => { const borderColor = { _light: 'whiteAlpha.800', _dark: 'blackAlpha.800' }; return ( ); }; type ContentProps = Omit & Pick; const Content = chakra((props: ContentProps) => { const nameString = getPoolTitle(props.pool); return ( { nameString } ); }); const Container = EntityBase.Container; export interface EntityProps extends EntityBase.EntityBaseProps { pool: Pool; } const PoolEntity = (props: EntityProps) => { const partsProps = distributeEntityProps(props); const content = ; return ( { props.noLink ? content : { content } } ); }; export default React.memo(chakra(PoolEntity)); export { Container, Link, Icon, Content, };