import { StyleTheme, useSettings } from "../context/settings"; export type GameId = 'reaction' | 'snake' | 'tetris' | 'pong' | 'drawing' | 'tanks'; /** Ikony miniher podle vizuálního stylu aplikace. */ const ICONS: Record> = { simple: { reaction: '⚡', snake: '🐍', tetris: '🧱', pong: '🏓', drawing: '🎨', tanks: '💥' }, // Dostihy: startovní vlajka, kůň místo hada, mrkve jako kostky, žokej, trofej, terč umamusume: { reaction: '🏁', snake: '🐎', tetris: '🥕', pong: '🏇', drawing: '🏆', tanks: '🎯' }, // Duha, jednorožec, drahokamy, balónky, paleta a blesk Rainbow Dash mlp: { reaction: '🌈', snake: '🦄', tetris: '💎', pong: '🎈', drawing: '🖌️', tanks: '⚡' }, // Pekelná korespondence: plamen, rudá nit, lampion, slaměná panenka, svitek, svíčka hellgirl: { reaction: '🔥', snake: '🪢', tetris: '🏮', pong: '🪆', drawing: '📜', tanks: '🕯️' }, // Klub lehké hudby: bicí Ritsu, želva Ton-chan, dortíky k čaji, kytara Gitah, notový zápis a klávesy Mugi kon: { reaction: '🥁', snake: '🐢', tetris: '🍰', pong: '🎸', drawing: '🎼', tanks: '🎹' }, // Kessoku Band: mikrofon Kity, kabel od kytary, krabice od manga, bicí Nijiky, sešit s texty Bocchi a její kytara bocchi: { reaction: '🎤', snake: '🔌', tetris: '📦', pong: '🥁', drawing: '📝', tanks: '🎸' }, }; /** Styl z — pro místa mimo React kontext nastavení. */ function currentTheme(): StyleTheme { const theme = document.documentElement.getAttribute('data-luncher-theme') as StyleTheme | null; return theme && theme in ICONS ? theme : 'simple'; } /** Ikona hry pro aktuální styl (mimo React, např. výpis do konzole). */ export const gameIcon = (game: GameId, theme: StyleTheme = currentTheme()) => ICONS[theme]?.[game] ?? ICONS.simple[game]; /** Ikona hry pro aktuální styl; stránky bez nastavení (statistiky) použijí atribut na . */ export function useGameIcon(game: GameId) { const settings = useSettings(); return gameIcon(game, settings?.styleTheme ?? currentTheme()); }