27 lines
No EOL
888 B
TypeScript
27 lines
No EOL
888 B
TypeScript
import { getCharacterImage, getWeaponImage, getSummonImage } from './images'
|
|
|
|
export function getCharacterImageUrl(gbid?: string | number): string {
|
|
// Use local square images for database tables
|
|
return getCharacterImage(gbid, 'square', '01')
|
|
}
|
|
|
|
export function getWeaponImageUrl(gbid?: string | number): string {
|
|
// Use local square images for database tables
|
|
return getWeaponImage(gbid, 'square')
|
|
}
|
|
|
|
export function getSummonImageUrl(gbid?: string | number): string {
|
|
// Use local square images for database tables
|
|
return getSummonImage(gbid, 'square')
|
|
}
|
|
|
|
export function getItemName(item: { name?: string | { en?: string; ja?: string } }): string {
|
|
const name = item.name
|
|
|
|
// Handle name object
|
|
if (!name) return '—'
|
|
if (typeof name === 'string') return name
|
|
|
|
// Handle name.en/name.ja structure (API returns { en: "...", ja: "..." })
|
|
return name.en || name.ja || '—'
|
|
} |