diff --git a/AppImage/components/storage-overview.tsx b/AppImage/components/storage-overview.tsx index b2af1b2..971cdc3 100644 --- a/AppImage/components/storage-overview.tsx +++ b/AppImage/components/storage-overview.tsx @@ -399,12 +399,14 @@ export function StorageOverview() { const totalProxmoxUsed = proxmoxStorage && proxmoxStorage.storage ? proxmoxStorage.storage - .filter((storage) => storage.total > 0 && storage.status.toLowerCase() === "active") + .filter( + (storage) => storage && storage.total > 0 && storage.status && storage.status.toLowerCase() === "active", + ) .reduce((sum, storage) => sum + storage.used, 0) : 0 const usagePercent = - storageData.total > 0 ? ((totalProxmoxUsed / (storageData.total * 1024)) * 100).toFixed(2) : "0.00" + storageData && storageData.total > 0 ? ((totalProxmoxUsed / (storageData.total * 1024)) * 100).toFixed(2) : "0.00" if (loading) { return ( @@ -511,76 +513,78 @@ export function StorageOverview() {
- {proxmoxStorage.storage.map((storage) => ( -
-
- {/* Desktop: Icon + Name + Badge tipo alineados horizontalmente */} -
- -

{storage.name}

- {storage.type} -
- -
- - {storage.type} -

{storage.name}

- {getStatusIcon(storage.status)} -
- - {/* Desktop: Badge active + Porcentaje */} -
- - {storage.status} - - {storage.percent}% -
-
- -
- 90 - ? "[&>div]:bg-red-500" - : storage.percent > 75 - ? "[&>div]:bg-yellow-500" - : "[&>div]:bg-blue-500" - }`} - /> -
-
-

Total

-

{storage.total.toLocaleString()} GB

+ {proxmoxStorage.storage + .filter((storage) => storage && storage.name && storage.total > 0) + .map((storage) => ( +
+
+ {/* Desktop: Icon + Name + Badge tipo alineados horizontalmente */} +
+ +

{storage.name}

+ {storage.type}
-
-

Used

-

90 - ? "text-red-400" - : storage.percent > 75 - ? "text-yellow-400" - : "text-blue-400" - }`} + +

+ + {storage.type} +

{storage.name}

+ {getStatusIcon(storage.status)} +
+ + {/* Desktop: Badge active + Porcentaje */} +
+ - {storage.used.toLocaleString()} GB -

+ {storage.status} +
+ {storage.percent}%
-
-

Available

-

{storage.available.toLocaleString()} GB

+
+ +
+ 90 + ? "[&>div]:bg-red-500" + : storage.percent > 75 + ? "[&>div]:bg-yellow-500" + : "[&>div]:bg-blue-500" + }`} + /> +
+
+

Total

+

{storage.total.toLocaleString()} GB

+
+
+

Used

+

90 + ? "text-red-400" + : storage.percent > 75 + ? "text-yellow-400" + : "text-blue-400" + }`} + > + {storage.used.toLocaleString()} GB +

+
+
+

Available

+

{storage.available.toLocaleString()} GB

+
-
- ))} + ))}