Reverted to commit 095907b3a5

This commit is contained in:
gpt-engineer-app[bot]
2025-10-04 19:16:36 +00:00
parent 58c28a37eb
commit 065b1b4be5
15 changed files with 257 additions and 680 deletions

View File

@@ -79,118 +79,109 @@ export default function Admin() {
return (
<>
<AdminHeader onRefresh={handleRefresh} />
<div className="container mx-auto px-4 py-8 max-w-7xl">
{/* Refresh status indicator - subtle */}
<div className="flex items-center gap-2 text-xs text-muted-foreground mb-6">
<RefreshCw className="w-3 h-3" />
{refreshMode === 'auto' ? (
<span>Auto-refresh: every {pollInterval / 1000}s</span>
) : (
<span>Manual refresh</span>
)}
{lastUpdated && (
<span> {lastUpdated.toLocaleTimeString()}</span>
)}
<div className="container mx-auto px-4 py-8">
<div className="space-y-4 mb-8">
{/* Refresh status indicator */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-2 text-sm text-muted-foreground">
<RefreshCw className="w-4 h-4" />
{refreshMode === 'auto' ? (
<span>Auto-refresh: every {pollInterval / 1000}s</span>
) : (
<span>Manual refresh only</span>
)}
{lastUpdated && (
<span className="text-xs">
Last updated: {lastUpdated.toLocaleTimeString()}
</span>
)}
</div>
</div>
{/* Stats cards - horizontal layout */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mb-12">
<Card className="border-border/50 hover:border-border/80 transition-colors">
<CardContent className="p-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="p-2 rounded-lg bg-amber-500/10">
<FileText className="h-5 w-5 text-amber-700 dark:text-amber-300" />
</div>
<div>
<p className="text-sm font-medium text-muted-foreground">Pending</p>
<p className="text-xs text-muted-foreground/80">Submissions</p>
</div>
</div>
<div className="text-4xl font-bold text-amber-700 dark:text-amber-300">
{stats.pendingSubmissions}
</div>
{/* Stats cards */}
<div className="grid grid-cols-3 gap-3 md:gap-6">
<Card>
<CardHeader className="flex flex-col items-center justify-center space-y-0 pb-2 text-center">
<FileText className="h-4 w-4 text-muted-foreground mb-2" />
<CardTitle className="text-sm font-medium">Pending Submissions</CardTitle>
</CardHeader>
<CardContent className="text-center">
<div className="text-2xl font-bold">
{stats.pendingSubmissions}
</div>
</CardContent>
</Card>
<Card className="border-border/50 hover:border-border/80 transition-colors">
<CardContent className="p-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="p-2 rounded-lg bg-red-500/10">
<Flag className="h-5 w-5 text-red-700 dark:text-red-300" />
</div>
<div>
<p className="text-sm font-medium text-muted-foreground">Open</p>
<p className="text-xs text-muted-foreground/80">Reports</p>
</div>
</div>
<div className="text-4xl font-bold text-red-700 dark:text-red-300">
{stats.openReports}
</div>
<Card>
<CardHeader className="flex flex-col items-center justify-center space-y-0 pb-2 text-center">
<Flag className="h-4 w-4 text-muted-foreground mb-2" />
<CardTitle className="text-sm font-medium">Open Reports</CardTitle>
</CardHeader>
<CardContent className="text-center">
<div className="text-2xl font-bold">
{stats.openReports}
</div>
</CardContent>
</Card>
<Card className="border-border/50 hover:border-border/80 transition-colors">
<CardContent className="p-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-3">
<div className="p-2 rounded-lg bg-orange-500/10">
<AlertCircle className="h-5 w-5 text-orange-700 dark:text-orange-300" />
</div>
<div>
<p className="text-sm font-medium text-muted-foreground">Flagged</p>
<p className="text-xs text-muted-foreground/80">Content</p>
</div>
</div>
<div className="text-4xl font-bold text-orange-700 dark:text-orange-300">
{stats.flaggedContent}
</div>
<Card>
<CardHeader className="flex flex-col items-center justify-center space-y-0 pb-2 text-center">
<AlertCircle className="h-4 w-4 text-muted-foreground mb-2" />
<CardTitle className="text-sm font-medium">Flagged Content</CardTitle>
</CardHeader>
<CardContent className="text-center">
<div className="text-2xl font-bold">
{stats.flaggedContent}
</div>
</CardContent>
</Card>
</div>
</div>
{/* Content Moderation Section - flatter design */}
<div className="space-y-8">
<div>
<h2 className="text-lg font-semibold mb-4 flex items-center gap-2">
<Shield className="w-5 h-5" />
Moderation Queue
</h2>
<Tabs defaultValue="queue" className="space-y-4">
<TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="queue" className="flex items-center gap-2">
<FileText className="w-4 h-4" />
{isMobile ? 'Queue' : 'Moderation Queue'}
</TabsTrigger>
<TabsTrigger value="reports" className="flex items-center gap-2">
<Flag className="w-4 h-4" />
Reports
</TabsTrigger>
</TabsList>
<TabsContent value="queue" className="mt-4">
<ModerationQueue ref={moderationQueueRef} />
</TabsContent>
<TabsContent value="reports" className="mt-4">
<ReportsQueue ref={reportsQueueRef} />
</TabsContent>
</Tabs>
</div>
{/* Content Moderation Section */}
<Card className="mb-8">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Shield className="w-5 h-5" />
Moderation Queue
</CardTitle>
</CardHeader>
<CardContent>
<Tabs defaultValue="queue" className="space-y-6">
<TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="queue" className="flex items-center gap-2">
<FileText className="w-4 h-4" />
{isMobile ? 'Queue' : 'Moderation Queue'}
</TabsTrigger>
<TabsTrigger value="reports" className="flex items-center gap-2">
<Flag className="w-4 h-4" />
Reports
</TabsTrigger>
</TabsList>
<TabsContent value="queue">
<ModerationQueue ref={moderationQueueRef} />
</TabsContent>
<TabsContent value="reports">
<ReportsQueue ref={reportsQueueRef} />
</TabsContent>
</Tabs>
</CardContent>
</Card>
{/* User Management Section - flatter design */}
<div>
<h2 className="text-lg font-semibold mb-4 flex items-center gap-2">
<Users className="w-5 h-5" />
User Management
</h2>
<UserManagement />
</div>
</div>
{/* User Management Section */}
<Card className="mb-8">
<CardHeader>
<CardTitle className="flex items-center gap-2">
<Users className="w-5 h-5" />
User Management
</CardTitle>
</CardHeader>
<CardContent>
<UserManagement />
</CardContent>
</Card>
</div>
</>
);