import { Tooltip, chakra } from '@chakra-ui/react'; import type { As } from '@chakra-ui/react'; import React from 'react'; import shortenString from 'lib/shortenString'; interface Props { hash: string; isTooltipDisabled?: boolean; as?: As; } const HashStringShorten = ({ hash, isTooltipDisabled, as = 'span' }: Props) => { if (hash.length <= 8) { return { hash }; } return ( { shortenString(hash) } ); }; export default HashStringShorten;