initial 2
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-06-26 09:26:50 +01:00
parent 194330fb47
commit 3b37368e7d
213 changed files with 14688 additions and 1 deletions

39
apps/web/src/stores/ui.ts Executable file
View File

@@ -0,0 +1,39 @@
"use client";
import { create } from "zustand";
interface UiState {
xpToast: { amount: number; message: string } | null;
showXpToast: (amount: number, message: string) => void;
clearXpToast: () => void;
actionToast: {
summary: string;
actionEventId: string;
} | null;
showActionToast: (summary: string, actionEventId: string) => void;
clearActionToast: () => void;
bookCelebration: { title: string } | null;
showBookCelebration: (title: string) => void;
clearBookCelebration: () => void;
welcomeBack: boolean;
setWelcomeBack: (v: boolean) => void;
aiOnline: boolean | null;
setAiOnline: (v: boolean | null) => void;
}
export const useUiStore = create<UiState>((set) => ({
xpToast: null,
showXpToast: (amount, message) => set({ xpToast: { amount, message } }),
clearXpToast: () => set({ xpToast: null }),
actionToast: null,
showActionToast: (summary, actionEventId) =>
set({ actionToast: { summary, actionEventId } }),
clearActionToast: () => set({ actionToast: null }),
bookCelebration: null,
showBookCelebration: (title) => set({ bookCelebration: { title } }),
clearBookCelebration: () => set({ bookCelebration: null }),
welcomeBack: false,
setWelcomeBack: (v) => set({ welcomeBack: v }),
aiOnline: null,
setAiOnline: (v) => set({ aiOnline: v }),
}));