This commit is contained in:
Christoph K.
2026-04-07 09:49:17 +02:00
parent 063aa67615
commit 4db170b467
37 changed files with 269 additions and 48 deletions

View File

@@ -1,5 +1,6 @@
import { create } from 'zustand';
/** Eine einzelne Toast-Benachrichtigung. */
export interface Toast {
id: string;
type: 'success' | 'error' | 'info';
@@ -12,6 +13,13 @@ interface ToastState {
removeToast: (id: string) => void;
}
/**
* Store für temporäre Benachrichtigungen.
*
* Toasts verschwinden nach 3 Sekunden automatisch.
* Wird aus anderen Stores via `useToastStore.getState().addToast()` aufgerufen,
* um Store-zu-Store-Abhängigkeiten zu vermeiden.
*/
export const useToastStore = create<ToastState>((set) => ({
toasts: [],