AVatar tooltip is the default

This commit is contained in:
Nate Kelley 2025-04-24 16:52:59 -06:00
parent 4bb83dbf17
commit 65c08cd641
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 3 additions and 2 deletions

View File

@ -12,16 +12,17 @@ export interface AvatarProps {
fallbackClassName?: string; fallbackClassName?: string;
useToolTip?: boolean; useToolTip?: boolean;
size?: number; size?: number;
tooltipTitle?: string | React.ReactNode;
} }
export const Avatar: React.FC<AvatarProps> = React.memo( export const Avatar: React.FC<AvatarProps> = React.memo(
({ image, name, className, useToolTip, size, fallbackClassName }) => { ({ image, name, className, useToolTip = true, size, fallbackClassName, tooltipTitle }) => {
const hasName = !!name; const hasName = !!name;
const nameLetters = createNameLetters(name); const nameLetters = createNameLetters(name);
const hasImage = !!image; const hasImage = !!image;
return ( return (
<Tooltip delayDuration={300} title={useToolTip ? name || '' : ''}> <Tooltip delayDuration={300} title={useToolTip ? tooltipTitle || name || '' : ''}>
<AvatarBase <AvatarBase
className={className} className={className}
style={{ style={{