feat: add admin operations suite
Local Build and Deploy / deploy (push) Successful in 50s

This commit is contained in:
Simo committed 2026-07-12 20:11:28 +02:00
1 parent 21a61068fb
commit 60278b9e71
38 files changed
+3452

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
import { type AvatarOptions, getAvatarUrl } from '@/lib/imager'
interface AvatarImageProps {
figure: string
options?: AvatarOptions
width: number
height: number
alt: string
className?: string
}
export function AvatarImage({
figure,
options,
width,
height,
alt,
className = '',
}: AvatarImageProps) {
// Auto-pick the smallest size that still looks crisp at the requested
// dimensions, unless the caller passed an explicit size.
const max = Math.max(width, height)
const autoSize: 's' | 'm' | 'l' =
options?.size ?? (options?.headOnly ? 'l' : max <= 40 ? 's' : max <= 80 ? 'm' : 'l')
return (
// eslint-disable-next-line @next/next/no-img-element
<img
src={getAvatarUrl(figure, { ...options, size: autoSize })}
alt={alt}
width={width}
height={height}
loading="lazy"
decoding="async"
style={{ maxWidth: width, maxHeight: height }}
className={`image-pixelated object-contain ${className}`}
/>
)
}