Fix: Cast entry to avoid TypeScript 'never' inference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-28 13:58:09 +02:00
parent ef821831a4
commit bd24fa6ba6

View File

@@ -39,7 +39,8 @@ export function NativeLanguageProvider({ children }: { children: React.ReactNode
const t = useCallback((key: ExerciseKey): string => { const t = useCallback((key: ExerciseKey): string => {
const entry = exerciseT[key] const entry = exerciseT[key]
if (!entry) return key if (!entry) return key
return (entry as Record<string, string>)[nativeLang] || entry.en || entry.de || key const e = entry as Record<string, string>
return e[nativeLang] || e['en'] || e['de'] || key
}, [nativeLang]) }, [nativeLang])
const wordInNative = useCallback((translations?: Record<string, any>): string => { const wordInNative = useCallback((translations?: Record<string, any>): string => {