import React from 'react';
import type { AvatarDecoration } from '@backspace/shared/src/profile';
interface DecoratedAvatarProps {
decoration: AvatarDecoration;
/** Avatar element to decorate; the overlay sizes itself to this box. */
children: React.ReactNode;
className?: string;
}
/**
* Wraps an avatar with a decorative layer. Every decoration is inline SVG on a
* 100×100 box around the picture — no image assets, so a new one is a few
* lines of markup and scales to any avatar size.
*/
export function DecoratedAvatar({ decoration, children, className = '' }: DecoratedAvatarProps) {
return (
{children}
{decoration !== 'none' && (
)}
);
}
function Decoration({ id }: { id: AvatarDecoration }) {
switch (id) {
case 'ring':
return (
);
case 'neon':
return (
);
case 'flames':
return (
);
case 'stars':
return (
);
case 'halo':
return (
);
case 'vines':
return (
);
case 'pixel':
return (
);
case 'hearts':
return (
);
case 'frost':
return (
);
case 'crown':
return (
);
default:
return null;
}
}