2024-08-01 22:46:46 +03:00

20 lines
528 B
TypeScript

import * as React from 'react';
import { Text, TextProps } from '@chakra-ui/react';
import truncateMiddle from 'truncate-middle';
interface UsernameProps extends TextProps {
address: string;
}
const Username: React.FunctionComponent<UsernameProps> = ({ address, ...otherProps }) => {
const data = address;
return (
<Text display='inline' textTransform={data ? 'none' : 'uppercase'} {...otherProps}>
{truncateMiddle(address || '', 6, 5, '...')}
</Text>
);
};
export default Username;