This commit is contained in:
HugeFrog24
2025-12-12 12:25:07 +01:00
parent 1edd996336
commit 39cbf58dbd
54 changed files with 7273 additions and 6889 deletions

18
app/hooks/useSkin.ts Normal file
View File

@@ -0,0 +1,18 @@
'use client';
import { useSearchParams } from 'next/navigation';
import { appConfig } from '../config/app';
import { SkinId } from '../types';
export function useSkin() {
const searchParams = useSearchParams();
const skinParam = searchParams.get('skin');
// Validate that the skin exists in our config
const isValidSkin = skinParam && Object.keys(appConfig.skins).includes(skinParam);
// Return the skin from URL if valid, otherwise return default skin
const currentSkin = (isValidSkin ? skinParam : appConfig.defaultSkin) as SkinId;
return currentSkin;
}