RedactX / src /ui /store /theme.ts
GitHub Actions
Deploy from GitHub
ac4a6d6
Raw
History Blame Contribute Delete
288 Bytes
import { create } from 'zustand';
type ThemeStore = {
theme: 'light' | 'dark';
toggleTheme: () => void;
};
export const useThemeStore = create<ThemeStore>((set) => ({
theme: 'dark',
toggleTheme: () => set((state) => ({ theme: state.theme === 'light' ? 'dark' : 'light' })),
}));