{
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
onClick?.();
}
}
: undefined
}
className={cn(
inline ? 'relative inline-flex' : 'fixed',
'flex items-start gap-2.5 max-w-[300px]',
'rounded-2xl border border-border bg-popover text-popover-foreground',
'px-3.5 py-2.5 shadow-2xl transition-all duration-200 ease-out',
clickable &&
'cursor-pointer hover:bg-accent/40 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring',
originClass(position),
animating ? 'opacity-0 scale-95 translate-y-1' : 'opacity-100 scale-100 translate-y-0',
className,
)}
style={{
...(inline ? {} : anchorStyle(position, fabOffset, fabClearance)),
...(inline ? {} : { zIndex }),
pointerEvents: phase === 'visible' ? 'auto' : 'none',
...style,
}}
>
{avatar ?? deriveAvatar(message.sender, displayName)}
{onDismiss ? (
) : null}
);
}