import React from 'react'; import { motion } from 'framer-motion'; import { FiCheckCircle, FiXCircle, FiInfo, FiAlertTriangle, FiX } from 'react-icons/fi'; import { useNotificationStore, type Notification } from '../../stores/notificationStore'; import Typography from '../ui/Typography'; import { cn } from '../../lib/utils'; interface NotificationItemProps { notification: Notification; } /** * Individual notification item component */ export const NotificationItem: React.FC = ({ notification }) => { const removeNotification = useNotificationStore((state) => state.removeNotification); /** * Notification icon component */ const NotificationIcon: React.FC<{ type: Notification['type'] }> = ({ type }) => { switch (type) { case 'success': return (
); case 'error': return (
); case 'warning': return (
); case 'info': default: return (
); } }; /** * Get background color class based on notification type */ const getBackgroundColor = (type: Notification['type']): string => { switch (type) { case 'success': return 'bg-gradient-to-br from-green-500/10 to-green-600/5 border-green-500/20'; case 'error': return 'bg-gradient-to-br from-red-500/10 to-red-600/5 border-red-500/20'; case 'warning': return 'bg-gradient-to-br from-yellow-500/10 to-yellow-600/5 border-yellow-500/20'; case 'info': default: return 'bg-gradient-to-br from-blue-500/10 to-blue-600/5 border-blue-500/20'; } }; return (
{notification.title} {notification.message && (
{notification.message}
)}
); };