mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-09 14:51:30 +01:00
10 lines
342 B
TypeScript
10 lines
342 B
TypeScript
import UniversalCookie from 'universal-cookie'
|
|
|
|
import { DEFAULT_THEME } from '@/utils/constants'
|
|
import type { CookiesStore, Theme } from '@/utils/constants'
|
|
|
|
export const useTheme = (cookiesStore: CookiesStore): Theme => {
|
|
const universalCookie = new UniversalCookie(cookiesStore)
|
|
return universalCookie.get('theme') ?? DEFAULT_THEME
|
|
}
|