import { Box, chakra, Flex, Text } from '@chakra-ui/react'; import React from 'react'; import { route } from 'nextjs-routes'; import config from 'configs/app'; import { Image } from 'toolkit/chakra/image'; import { Link as LinkToolkit } from 'toolkit/chakra/link'; import { Skeleton } from 'toolkit/chakra/skeleton'; import { Tooltip } from 'toolkit/chakra/tooltip'; import * as EntityBase from 'ui/shared/entities/base/components'; import IconSvg from 'ui/shared/IconSvg'; import { distributeEntityProps, getIconProps } from '../base/utils'; const nameServicesFeature = config.features.nameServices; const clustersFeature = nameServicesFeature.isEnabled && nameServicesFeature.clusters.isEnabled ? nameServicesFeature.clusters : undefined; type LinkProps = EntityBase.LinkBaseProps & Pick; const Link = chakra((props: LinkProps) => { const defaultHref = route({ pathname: '/name-services/clusters/[name]', query: { name: encodeURIComponent(props.clusterName) } }); return ( { props.children } ); }); type IconProps = EntityBase.IconBaseProps & Pick; const Icon = (props: IconProps) => { if (props.noIcon) { return null; } const styles = getIconProps(props, Boolean(props.shield)); if (props.isLoading) { return ; } const fallbackElement = ( ); const profileImageElement = ( { ); const tooltipContent = ( <>
Clusters - Universal name service
Clusters provides unified naming across multiple blockchains including EVM, Solana, Bitcoin, and more. Manage all your wallet addresses under one human-readable name. Learn more about Clusters ); return ( { profileImageElement } ); }; type ContentProps = Omit & Pick; const Content = chakra((props: ContentProps) => { const shouldShowTrailingSlash = !props.clusterName.includes('/'); const displayName = shouldShowTrailingSlash ? `${ props.clusterName }/` : props.clusterName; return ( ); }); type CopyProps = Omit & Pick; const Copy = (props: CopyProps) => { return ( ); }; const Container = EntityBase.Container; export interface EntityProps extends EntityBase.EntityBaseProps { clusterName: string; } const ClustersEntity = (props: EntityProps) => { const partsProps = distributeEntityProps(props); const content = ; return ( { props.noLink ? content : { content } } ); }; export default React.memo(chakra(ClustersEntity)); export { Container, Link, Icon, Content, Copy, };