import React from 'react'; import { useAvatarDecoration } from '../../hooks/useAvatarDecoration'; import { decorationUrl } from '../../features/lotus/avatarDecorations'; const DEFAULT_INSET = 8; type AvatarDecorationProps = { userId: string; children: React.ReactNode; inset?: number; }; export function AvatarDecoration({ userId, children, inset = DEFAULT_INSET, }: AvatarDecorationProps) { const slug = useAvatarDecoration(userId); if (!slug) { return <>{children}; } return (
{children} { (e.currentTarget as HTMLImageElement).style.display = 'none'; }} />
); }