website refactor
This commit is contained in:
@@ -1,35 +1,26 @@
|
||||
import Card from '@/components/ui/Card';
|
||||
import {
|
||||
Users,
|
||||
Shield,
|
||||
Activity,
|
||||
Clock,
|
||||
AlertTriangle,
|
||||
import {
|
||||
Users,
|
||||
Shield,
|
||||
Activity,
|
||||
Clock,
|
||||
RefreshCw
|
||||
} from 'lucide-react';
|
||||
import { AdminDashboardViewData } from '@/lib/view-data/AdminDashboardViewData';
|
||||
|
||||
interface AdminDashboardTemplateProps {
|
||||
viewData: AdminDashboardViewData;
|
||||
onRefresh: () => void;
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* AdminDashboardTemplate
|
||||
*
|
||||
* Pure template for admin dashboard.
|
||||
* Accepts ViewData only, no business logic.
|
||||
*/
|
||||
export function AdminDashboardTemplate({
|
||||
viewData,
|
||||
onRefresh,
|
||||
isLoading
|
||||
}: AdminDashboardTemplateProps) {
|
||||
// Temporary UI fields (not yet provided by API/ViewModel)
|
||||
const adminCount = viewData.stats.systemAdmins;
|
||||
const systemHealth = 'Healthy';
|
||||
|
||||
export function AdminDashboardTemplate(props: {
|
||||
adminDashboardViewData: AdminDashboardViewData;
|
||||
onRefresh: () => void;
|
||||
isLoading: boolean;
|
||||
}) {
|
||||
const { adminDashboardViewData: viewData, onRefresh, isLoading } = props;
|
||||
|
||||
return (
|
||||
<div className="container mx-auto p-6 space-y-6">
|
||||
{/* Header */}
|
||||
@@ -64,7 +55,7 @@ export function AdminDashboardTemplate({
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<div className="text-sm text-gray-400 mb-1">Admins</div>
|
||||
<div className="text-3xl font-bold text-white">{adminCount}</div>
|
||||
<div className="text-3xl font-bold text-white">{viewData.stats.systemAdmins}</div>
|
||||
</div>
|
||||
<Shield className="w-8 h-8 text-purple-400" />
|
||||
</div>
|
||||
@@ -98,7 +89,7 @@ export function AdminDashboardTemplate({
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-sm text-gray-400">System Health</span>
|
||||
<span className="px-2 py-1 text-xs rounded-full bg-performance-green/20 text-performance-green">
|
||||
{systemHealth}
|
||||
Healthy
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
|
||||
Reference in New Issue
Block a user