gaming updates

This commit is contained in:
Greg Kilmer
2026-07-06 19:13:15 -04:00
parent 9b3c15b67b
commit 7808c2ead8
36 changed files with 825 additions and 84 deletions
+24
View File
@@ -0,0 +1,24 @@
/**
* platforms.ts
* ---------------------------------------------------------------------------
* Helpers for mapping a free-form platform string (as authored in the games /
* nowPlaying content) to an mdi icon name. Kept here so it can be shared
* between the gaming page and any future components without coupling to the
* content collection config.
*/
/**
* Returns an mdi icon name (without the `mdi:` prefix) for a platform string.
* Matches case-insensitively on substrings; unknown platforms fall back to a
* generic gamepad.
*
* @example platformToIcon("PlayStation 5") // "sony-playstation"
*/
export const platformToIcon = (platform: string): string => {
const p = platform.toLowerCase();
if (p.includes('playstation') || p.includes('ps5') || p.includes('ps4')) return 'sony-playstation';
if (p.includes('switch')) return 'nintendo-switch';
if (p.includes('steam') || p.includes('pc')) return 'steam';
if (p.includes('xbox')) return 'microsoft-xbox';
return 'gamepad-variant';
};