import React from 'react'; import { Tooltip } from './Tooltip'; interface UsernameProps { username: string; showAt?: boolean; className?: string; style?: React.CSSProperties; } export function Username({ username, showAt, className, style }: UsernameProps) { const atIndex = username.indexOf('@'); const prefix = showAt ? '@' : ''; if (atIndex === -1) { return {prefix}{username}; } const name = username.slice(0, atIndex); const domain = username.slice(atIndex + 1); return ( {prefix}{name} @{domain} ); }