1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-19 04:49:37 +02:00

Update adventure type label handling and improve map marker display

This commit is contained in:
Sean Morley 2024-11-02 21:29:42 -04:00
parent 07263c5697
commit 6137411b84
2 changed files with 23 additions and 25 deletions

View file

@ -279,11 +279,13 @@ export let ADVENTURE_TYPE_ICONS = {
other: '❓'
};
type AdventureType = keyof typeof ADVENTURE_TYPE_ICONS;
export function getAdventureTypeLabel(type: AdventureType) {
const typeObj = ADVENTURE_TYPE_ICONS[type];
return typeObj;
export function getAdventureTypeLabel(type: string) {
// return the emoji ADVENTURE_TYPE_ICONS label for the given type if not found return ? emoji
if (type in ADVENTURE_TYPE_ICONS) {
return ADVENTURE_TYPE_ICONS[type as keyof typeof ADVENTURE_TYPE_ICONS];
} else {
return '❓';
}
}
export function getRandomBackground() {