diff --git a/src/components/NotificationList.jsx b/src/components/NotificationList.jsx
index f6c75e1..81c3b9c 100644
--- a/src/components/NotificationList.jsx
+++ b/src/components/NotificationList.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { motion, AnimatePresence } from 'framer-motion';
+import { AnimatePresence, motion as Motion } from 'framer-motion';
import { useNotification } from '../context/NotificationContext';
import { formatTime, formatDate } from '../utils/format';
@@ -41,10 +41,10 @@ const NotificationList = () => {
)}
+
{notifications.map((notification, index) => (
- {
✕
-
+
))}
diff --git a/src/components/StatusCard.jsx b/src/components/StatusCard.jsx
index 686ff89..a96dadf 100644
--- a/src/components/StatusCard.jsx
+++ b/src/components/StatusCard.jsx
@@ -2,7 +2,7 @@ import React from 'react';
import { motion } from 'framer-motion';
import { useApp } from '../context/AppContext';
-const StatusCard = ({ title, value, subtitle, icon, color, onClick }) => {
+const StatusCard = ({ title, value: propValue, subtitle: propSubtitle, icon, color: propColor, onClick }) => {
const { state } = useApp();
const getStatusColor = () => {
@@ -38,6 +38,11 @@ const StatusCard = ({ title, value, subtitle, icon, color, onClick }) => {
const warningLevel = getWarningLevel();
+ // Build derived values without mutating props
+ let value = propValue;
+ let subtitle = propSubtitle;
+ let color = propColor || 'status-offline';
+
if (title === 'Inverter Status') {
value = `${getStatusIcon()} ${state.inverterStatus.toUpperCase()}`;
color = getStatusColor();
@@ -77,11 +82,24 @@ const StatusCard = ({ title, value, subtitle, icon, color, onClick }) => {
}
}
+ if (title === 'Energy Usage') {
+ value = `${state.energyConsumption}W`;
+ if (state.energyConsumption > 500) {
+ subtitle = 'High consumption';
+ color = 'status-warning-battery';
+ } else if (state.energyConsumption > 300) {
+ subtitle = 'Moderate consumption';
+ color = 'status-standby';
+ } else {
+ subtitle = 'Low consumption';
+ color = 'status-online';
+ }
+ }
+
return (
{
role="region"
aria-label="System status cards"
>
-
-
-
-
+
+
+
+
{/* Energy Usage Card - Separate row for better mobile layout */}
@@ -82,10 +82,7 @@ const Dashboard = () => {
>