fix: restore SuperAdmin page to valid mock state
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m41s

This commit is contained in:
Cauê Faleiros
2026-02-24 14:19:13 -03:00
parent 37f6ae042d
commit 96a96498b9

View File

@@ -1,16 +1,13 @@
import React, { useState, useMemo } from 'react'; import React, { useState, useMemo } from 'react';
import { import {
Building2, Users, MessageSquare, Plus, Search, MoreHorizontal, Building2, Users, MessageSquare, Plus, Search,
Edit, Trash2, Shield, Calendar, ChevronDown, ChevronUp, ChevronsUpDown, X Edit, Trash2, ChevronDown, ChevronUp, ChevronsUpDown, X
} from 'lucide-react'; } from 'lucide-react';
import { TENANTS, MOCK_ATTENDANCES, USERS } from '../constants'; import { TENANTS } from '../constants';
import { Tenant } from '../types'; import { Tenant } from '../types';
import { DateRangePicker } from '../components/DateRangePicker'; import { DateRangePicker } from '../components/DateRangePicker';
import { KPICard } from '../components/KPICard'; import { KPICard } from '../components/KPICard';
// Reusing KPICard but simplifying logic for this view if needed
// We can use the existing KPICard component.
export const SuperAdmin: React.FC = () => { export const SuperAdmin: React.FC = () => {
const [dateRange, setDateRange] = useState({ const [dateRange, setDateRange] = useState({
start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000), start: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
@@ -28,7 +25,6 @@ export const SuperAdmin: React.FC = () => {
// --- Metrics --- // --- Metrics ---
const totalTenants = tenants.length; const totalTenants = tenants.length;
// Mock aggregation for demo
const totalUsersGlobal = tenants.reduce((acc, t) => acc + (t.user_count || 0), 0); const totalUsersGlobal = tenants.reduce((acc, t) => acc + (t.user_count || 0), 0);
const totalAttendancesGlobal = tenants.reduce((acc, t) => acc + (t.attendance_count || 0), 0); const totalAttendancesGlobal = tenants.reduce((acc, t) => acc + (t.attendance_count || 0), 0);