init
This commit is contained in:
@@ -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: [],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user