1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-09-17 05:25:54 +02:00
.profile/theme/theme.client.ts

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
}