From b2108dfaa9ee4f39425d6e28c9cbd25f23d835f5 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 4 Jan 2026 19:52:35 -0800 Subject: [PATCH] add image/label helpers for proficiency and rarity --- src/lib/utils/proficiency.ts | 6 ++++++ src/lib/utils/rarity.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/lib/utils/proficiency.ts b/src/lib/utils/proficiency.ts index e0a508bb..529f6579 100644 --- a/src/lib/utils/proficiency.ts +++ b/src/lib/utils/proficiency.ts @@ -32,3 +32,9 @@ export function getProficiencyOptions() { label })) } + +export function getProficiencyImage(proficiency: number): string { + const label = PROFICIENCY_LABELS[proficiency] + if (!label || label === 'None') return '' + return `/images/proficiencies/${label.toLowerCase()}.png` +} diff --git a/src/lib/utils/rarity.ts b/src/lib/utils/rarity.ts index cfb45f2d..e72fa4c7 100644 --- a/src/lib/utils/rarity.ts +++ b/src/lib/utils/rarity.ts @@ -26,4 +26,10 @@ export function getRarityClass(rarity: number): string { default: return '' } +} + +export function getRarityImage(rarity: number): string { + const label = RARITY_LABELS[rarity] + if (!label) return '' + return `/images/rarity/${label.toLowerCase()}.png` } \ No newline at end of file