diff --git a/frontend/src/components/settings/admin/AdminStatsTab.jsx b/frontend/src/components/settings/admin/AdminStatsTab.jsx
index 6950c8b..b8564da 100644
--- a/frontend/src/components/settings/admin/AdminStatsTab.jsx
+++ b/frontend/src/components/settings/admin/AdminStatsTab.jsx
@@ -1,17 +1,18 @@
import React from 'react';
-import {
- Grid,
- Card,
- Stack,
- Text,
- Title,
- LoadingOverlay,
- Alert,
- RingProgress,
-} from '@mantine/core';
-import { IconUsers, IconFolders, IconAlertCircle } from '@tabler/icons-react';
+import { Table, Text, Box, LoadingOverlay, Alert } from '@mantine/core';
+import { IconAlertCircle } from '@tabler/icons-react';
import { useAdmin } from '../../../hooks/useAdmin';
-import StatCard from './StatCard';
+
+const formatBytes = (bytes) => {
+ const units = ['B', 'KB', 'MB', 'GB'];
+ let size = bytes;
+ let unitIndex = 0;
+ while (size >= 1024 && unitIndex < units.length - 1) {
+ size /= 1024;
+ unitIndex++;
+ }
+ return `${size.toFixed(1)} ${units[unitIndex]}`;
+};
const AdminStatsTab = () => {
const { data: stats, loading, error } = useAdmin('stats');
@@ -28,61 +29,37 @@ const AdminStatsTab = () => {
);
}
+ const statsRows = [
+ { label: 'Total Users', value: stats.totalUsers },
+ { label: 'Active Users', value: stats.activeUsers },
+ { label: 'Total Workspaces', value: stats.totalWorkspaces },
+ { label: 'Total Files', value: stats.totalFiles },
+ { label: 'Total Storage Size', value: formatBytes(stats.totalSize) },
+ ];
+
return (
-