Files
paint-ui/components/providers/toast-provider.tsx
Sebastian Krüger 3ad7dbf314 feat(ui): implement comprehensive toast notification system
Added a complete toast notification system with:
- Toast store using Zustand for state management
- Toast component with 4 types: success, error, warning, info
- Animated slide-in/slide-out transitions
- Auto-dismiss after configurable duration
- Close button on each toast
- Utility functions for easy access (toast.success(), toast.error(), etc.)

Integrated toast notifications into file operations:
- Success notifications for: open image, open project, export image, save project
- Error notifications for: failed operations
- Warning notifications for: unsupported file types

UI Features:
- Stacks toasts in top-right corner
- Color-coded by type with icons (CheckCircle, AlertCircle, AlertTriangle, Info)
- Accessible with ARIA attributes
- Smooth animations using custom CSS keyframes

This provides immediate user feedback for all major operations throughout
the application.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 15:42:50 +01:00

25 lines
562 B
TypeScript

'use client';
import { useToastStore } from '@/store/toast-store';
import { Toast } from '@/components/ui/toast';
export function ToastProvider() {
const { toasts } = useToastStore();
if (toasts.length === 0) return null;
return (
<div
className="fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none"
aria-live="polite"
aria-atomic="true"
>
{toasts.map((toast) => (
<div key={toast.id} className="pointer-events-auto">
<Toast toast={toast} />
</div>
))}
</div>
);
}