typescript
import React from 'react'
import { useToast } from '../contexts/ToastContext'
import { CheckCircle, XCircle, AlertTriangle, Info, X } from 'lucide-react'
const ToastContainer: React.FC = () => {
const { toasts, removeToast } = useToast()
const getToastIcon = (type: string) => {
switch (type) {
case 'success':
return
case 'error':
return
case 'warning':
return
case 'info':
return
default:
return
}
}
const getToastStyles = (type: string) => {
switch (type) {
case 'success':
return 'bg-accent-50 border-accent-200'
case 'error':
return 'bg-red-50 border-red-200'
case 'warning':
return 'bg-alert-50 border-alert-200'
case 'info':
return 'bg-primary-50 border-primary-200'
default:
return 'bg-gray-50 border-gray-200'
}
}
return (
{toasts.map((toast) => (
{getToastIcon(toast.type)}
{toast.title}
{toast.message && (
{toast.message}
))}
)
}
export default ToastContainer