feat: add LocaleProvider and hooks for managing locale and timezone settings
This commit is contained in:
11
src/hooks/use-locale.ts
Normal file
11
src/hooks/use-locale.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { LocaleProviderContext } from '@/contexts/LocaleContext'
|
||||
import { useContext } from 'react'
|
||||
|
||||
export const useLocale = () => {
|
||||
const context = useContext(LocaleProviderContext)
|
||||
|
||||
if (context === undefined)
|
||||
throw new Error('useLocale must be used within a LocaleProvider')
|
||||
|
||||
return context
|
||||
}
|
||||
Reference in New Issue
Block a user