testing theme editor

This commit is contained in:
RandyJC
2025-12-09 09:55:41 +01:00
parent 497dd2ea4c
commit 3d247513ce
5 changed files with 223 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
import { create } from "zustand"
import { persist } from "zustand/middleware"
type ThemeState = {
backgroundUrl: string | null
setBackground: (_url: string | null) => void
reset: () => void
}
export const useThemeStore = create<ThemeState>()(
persist(
(set) => ({
backgroundUrl: null,
setBackground: (backgroundUrl) => set({ backgroundUrl }),
reset: () => set({ backgroundUrl: null }),
}),
{ name: "theme-preferences" },
),
)