diff --git a/backend/static/js/alpine-components.js b/backend/static/js/alpine-components.js index 294533e2..4799f991 100644 --- a/backend/static/js/alpine-components.js +++ b/backend/static/js/alpine-components.js @@ -325,51 +325,6 @@ Alpine.data('pagination', (initialPage = 1, totalPages = 1) => ({ } })); -// Toast/Alert Component -Alpine.data('toast', () => ({ - toasts: [], - - show(message, type = 'info', duration = 5000) { - const id = Date.now(); - const toast = { id, message, type, visible: true }; - - this.toasts.push(toast); - - if (duration > 0) { - setTimeout(() => { - this.hide(id); - }, duration); - } - - return id; - }, - - hide(id) { - const toast = this.toasts.find(t => t.id === id); - if (toast) { - toast.visible = false; - setTimeout(() => { - this.toasts = this.toasts.filter(t => t.id !== id); - }, 300); // Wait for animation - } - }, - - success(message, duration) { - return this.show(message, 'success', duration); - }, - - error(message, duration) { - return this.show(message, 'error', duration); - }, - - warning(message, duration) { - return this.show(message, 'warning', duration); - }, - - info(message, duration) { - return this.show(message, 'info', duration); - } -})); // Enhanced Authentication Modal Component Alpine.data('authModal', (defaultMode = 'login') => ({ @@ -568,62 +523,6 @@ Alpine.data('authModal', (defaultMode = 'login') => ({ } })); -// Enhanced Toast Component with Better UX -Alpine.data('toast', () => ({ - toasts: [], - - show(message, type = 'info', duration = 5000) { - const id = Date.now() + Math.random(); - const toast = { - id, - message, - type, - visible: true, - progress: 100 - }; - - this.toasts.push(toast); - - if (duration > 0) { - // Animate progress bar - const interval = setInterval(() => { - toast.progress -= (100 / (duration / 100)); - if (toast.progress <= 0) { - clearInterval(interval); - this.hide(id); - } - }, 100); - } - - return id; - }, - - hide(id) { - const toast = this.toasts.find(t => t.id === id); - if (toast) { - toast.visible = false; - setTimeout(() => { - this.toasts = this.toasts.filter(t => t.id !== id); - }, 300); - } - }, - - success(message, duration = 5000) { - return this.show(message, 'success', duration); - }, - - error(message, duration = 7000) { - return this.show(message, 'error', duration); - }, - - warning(message, duration = 6000) { - return this.show(message, 'warning', duration); - }, - - info(message, duration = 5000) { - return this.show(message, 'info', duration); - } -})); // Global Store for App State Alpine.store('app', {