import React from 'react'; import { useAvatarDecoration } from '../../hooks/useAvatarDecoration'; import { useReducedMotion } from '../../hooks/useReducedMotion'; 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); const reducedMotion = useReducedMotion(); // Decorations are animated APNGs with no static asset to freeze to, so honor // prefers-reduced-motion by not rendering the animation at all (consistent // with the rest of the theming stack — chat backgrounds / seasonal overlays — // which all suppress motion under this preference; also avoids dozens of live // APNGs animating in scrolling mobile lists). if (!slug || reducedMotion) { return <>{children}>; } return (