fix: restore complete admin feature dependencies

This commit is contained in:
Simo committed 2026-07-11 21:15:54 +02:00
1 parent 5b4228261a
commit 0cd753c735
115 files changed
+18565 -4930

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
/**
* Centralized Habbo avatar imager utility.
* Points to the self-hosted imager API (`/api/imaging/avatar`) which handles
* disk + memory caching and (Phase 2) local rendering from .nitro bundles.
* Override with NEXT_PUBLIC_IMAGER_URL when needed (e.g. CDN in front).
*/
const IMAGER_URL = process.env.NEXT_PUBLIC_IMAGER_URL || '/api/imaging/avatar'
export type { AvatarOptions } from '@/types/admin'
import type { AvatarOptions } from '@/types/admin'
/**
* Build an avatar image URL served by the self-hosted imager.
*
* @example
* getAvatarUrl('hr-893-45.hd-180-1.ch-210-66.lg-270-82')
* getAvatarUrl(look, { size: 'l', headOnly: true })
* getAvatarUrl(look, { size: 'm', gesture: 'sml', direction: 2 })
*/
export function getAvatarUrl(figure: string, options: AvatarOptions = {}): string {
const {
size = 'm',
direction = 2,
headDirection = 3,
headOnly = false,
gesture,
action,
} = options
const params = new URLSearchParams({
figure,
direction: String(direction),
head_direction: String(headDirection),
size,
})
if (headOnly) params.set('headonly', '1')
if (gesture) params.set('gesture', gesture)
if (action) params.set('action', action)
return `${IMAGER_URL}?${params.toString()}`
}