+
+
+ Rating
+
+
+
+
+
+
+
+ Difficulty
+
+
+
+
+
+
+ {{
+ difficultyEmojis[Math.floor(romUser.difficulty) - 1] ??
+ difficultyEmojis[3]
+ }}
+
+
+
+
+
+ Completion %
+
+
+
+
+
+ {{ romUser.completion }}%
+
+
+
- {{ getTextForStatus(item.raw as RomUserStatus) }}
+ {{ getEmojiForStatus(item.raw as RomUserStatus) }}{{
+ getTextForStatus(item.raw as RomUserStatus)
+ }}
- {{ getTextForStatus(item.raw as RomUserStatus) }}
+ {{ getEmojiForStatus(item.raw as RomUserStatus) }}{{
+ getTextForStatus(item.raw as RomUserStatus)
+ }}
@@ -175,6 +214,7 @@ watch(
+
diff --git a/frontend/src/utils/index.ts b/frontend/src/utils/index.ts
index 963ca6466..faee99ca9 100644
--- a/frontend/src/utils/index.ts
+++ b/frontend/src/utils/index.ts
@@ -369,6 +369,19 @@ export function isRuffleEmulationSupported(
type PlayingStatus = RomUserStatus | "backlogged" | "now_playing" | "hidden";
+export const difficultyEmojis = [
+ "😴",
+ "🥱",
+ "😐",
+ "😄",
+ "🤔",
+ "🤯",
+ "😓",
+ "😡",
+ "🤬",
+ "😵",
+];
+
export const romStatusMap: Record<
PlayingStatus,
{ emoji: string; text: string }
@@ -388,11 +401,19 @@ const inverseRomStatusMap = Object.fromEntries(
) as Record;
export function getEmojiForStatus(status: PlayingStatus) {
- return romStatusMap[status].emoji;
+ if (status) {
+ return romStatusMap[status].emoji;
+ } else {
+ return null;
+ }
}
export function getTextForStatus(status: PlayingStatus) {
- return romStatusMap[status].text;
+ if (status) {
+ return romStatusMap[status].text;
+ } else {
+ return null;
+ }
}
export function getStatusKeyForText(text: string) {