/** 统一处理 localStorage */

import type { ThemeName } from "@/hooks/useTheme"
import CacheKey from "@/constants/cacheKey"

export function getSidebarStatus() {
  return localStorage.getItem(CacheKey.SIDEBAR_STATUS)
}
export function setSidebarStatus(sidebarStatus: "opened" | "closed") {
  localStorage.setItem(CacheKey.SIDEBAR_STATUS, sidebarStatus)
}

export function getActiveThemeName() {
  return localStorage.getItem(CacheKey.ACTIVE_THEME_NAME) as ThemeName
}
export function setActiveThemeName(themeName: ThemeName) {
  localStorage.setItem(CacheKey.ACTIVE_THEME_NAME, themeName)
}
