diff --git a/.env b/.env index 6160c3f..bae8a6f 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -DEBUG_MODE=true +VITE_DEBUG_MODE=false -VITE_EFC_API_URL=https://api.efc-aduanasoft.com/api/v1 -VITE_EFC_MICROSERVICE_URL=https://api.efc-aduanasoft.com/microservice/api/v1 +VITE_EFC_API_URL=http://192.168.1.195:8000/api/v1 +VITE_EFC_MICROSERVICE_URL=http://192.168.1.195:8001/api/v1 diff --git a/src/components/NotificationBell.jsx b/src/components/NotificationBell.jsx index 4d4976c..24d07f3 100644 --- a/src/components/NotificationBell.jsx +++ b/src/components/NotificationBell.jsx @@ -57,25 +57,33 @@ export default function NotificationBell() { switch (tipo) { case 'success': return ( -
- - +
+ +
); case 'warning': return ( -
- - +
+ + + +
+ ); + case 'error': + return ( +
+ +
); default: return ( -
- - +
+ +
); @@ -97,123 +105,196 @@ export default function NotificationBell() { return ( <> - {/* Campanita flotante */} + {/* Campanita flotante con diseño mejorado */}
- -
- - {/* Panel de notificaciones */} - {showPanel && ( -
- {/* Header del panel */} -
-

Notificaciones

-
- {unreadCount > 0 && ( - - )} - -
-
- - {/* Lista de notificaciones */} -
- {loading ? ( -
Cargando notificaciones...
- ) : error ? ( -
{error}
- ) : notifications.length === 0 ? ( -
- - - -

No hay notificaciones

-

Cuando tengas nuevas notificaciones aparecerán aquí.

-
- ) : ( -
- {notifications.map((notification) => ( -
markAsRead(notification.id)} - > -
- {getNotificationIcon(notification.tipo?.tipo)} -
-
-

- {notification.tipo?.descripcion || notification.tipo?.tipo || 'Notificación'} -

- - {formatTimestamp(notification.fecha_envio || notification.created_at)} - -
-

{notification.mensaje}

- {!notification.visto && ( -
- -
- )} -
-
-
- ))} + +
+ + {/* Indicador de estado activo */} + {showPanel && ( +
+ )} + +
+
- {/* Footer del panel */} - {notifications.length > 0 && ( -
- + {/* Panel de notificaciones con diseño mejorado */} + {showPanel && ( +
+ {/* Animación de entrada */} +
+
+ {/* Header del panel mejorado */} +
+
+
+
+ + + +
+
+

Notificaciones

+

+ {unreadCount > 0 ? `${unreadCount} nuevas` : 'Todas leídas'} +

+
+
+ +
+ {unreadCount > 0 && ( + + )} + +
+
+
+ + {/* Lista de notificaciones con diseño mejorado */} +
+ {loading ? ( +
+
+ + + + + Cargando notificaciones... +
+
+ ) : error ? ( +
+
+ + + + {error} +
+
+ ) : notifications.length === 0 ? ( +
+
+ + + +
+

No hay notificaciones

+

Cuando tengas nuevas notificaciones aparecerán aquí.

+
+ ) : ( +
+ {notifications.map((notification, index) => ( +
markAsRead(notification.id)} + style={{ animationDelay: `${index * 50}ms` }} + > +
+ {getNotificationIcon(notification.tipo?.tipo)} +
+
+

+ {notification.tipo?.descripcion || notification.tipo?.tipo || 'Notificación'} +

+
+ + {formatTimestamp(notification.fecha_envio || notification.created_at)} + + {!notification.visto && ( +
+ )} +
+
+

{notification.mensaje}

+ {!notification.visto && ( +
+
+ Nueva +
+ )} +
+
+
+ ))} +
+ )} +
+ + {/* Footer del panel mejorado */} + {notifications.length > 0 && ( +
+ +
+ )}
- )} +
)} - {/* Overlay para cerrar el panel al hacer clic fuera */} + {/* Overlay para cerrar el panel al hacer clic fuera con animación */} {showPanel && (
setShowPanel(false)} /> )}