This commit is contained in:
2026-03-29 10:26:38 -05:00
parent 05d4f6e78b
commit b1c99893a6
1628 changed files with 67782 additions and 60143 deletions

View File

@@ -1,27 +1,27 @@
'use client'
import { createContext, useContext, useState, ReactNode } from 'react'
import { Lang, translations } from '@/lib/i18n'
interface LangCtx {
lang: Lang
setLang: (l: Lang) => void
t: typeof translations.de
}
const LangContext = createContext<LangCtx>({
lang: 'de',
setLang: () => {},
t: translations.de,
})
export function LangProvider({ children }: { children: ReactNode }) {
const [lang, setLang] = useState<Lang>('de')
return (
<LangContext.Provider value={{ lang, setLang, t: translations[lang] }}>
{children}
</LangContext.Provider>
)
}
export const useLang = () => useContext(LangContext)
'use client'
import { createContext, useContext, useState, ReactNode } from 'react'
import { Lang, translations } from '@/lib/i18n'
interface LangCtx {
lang: Lang
setLang: (l: Lang) => void
t: typeof translations.de
}
const LangContext = createContext<LangCtx>({
lang: 'de',
setLang: () => {},
t: translations.de,
})
export function LangProvider({ children }: { children: ReactNode }) {
const [lang, setLang] = useState<Lang>('de')
return (
<LangContext.Provider value={{ lang, setLang, t: translations[lang] }}>
{children}
</LangContext.Provider>
)
}
export const useLang = () => useContext(LangContext)