1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-05 04:51:30 +01:00
.profile/theme/theme.client.ts

10 lines
342 B
TypeScript
Raw Normal View History

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
}