Added online status to sidebar

This commit is contained in:
2025-09-13 23:28:47 +02:00
parent d754fc0b37
commit 781338a81b
7 changed files with 399 additions and 1 deletions

18
đ Normal file
View File

@@ -0,0 +1,18 @@
import { GAMES, MODES } from "@/data/hypixel/hypixel"
export function getGame(val: string) {
const game = GAMES.find(g => g.id === val)
return game || null
}
export function getGameMode(gameType?: string, mode?: string) {
if (!gameType || !mode) return null
const game = getGame(gameType)
if (!game) return null
const gameModes = MODES[gameType as keyof typeof MODES]
if (!gameModes) return null
const modeValue = gameModes[mode as keyof typeof gameModes]
return modeValue || null
}