mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 16:31:13 -05:00
feat: Implement admin panel redesign plan
This commit is contained in:
@@ -7,7 +7,7 @@ import { Switch } from '@/components/ui/switch';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { AdminHeader } from '@/components/layout/AdminHeader';
|
||||
import { AdminLayout } from '@/components/layout/AdminLayout';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useUserRole } from '@/hooks/useUserRole';
|
||||
import { useAdminSettings } from '@/hooks/useAdminSettings';
|
||||
@@ -28,52 +28,45 @@ export default function AdminSettings() {
|
||||
|
||||
if (roleLoading || isLoading) {
|
||||
return (
|
||||
<>
|
||||
<AdminHeader />
|
||||
<div className="flex items-center justify-center min-h-screen">
|
||||
<AdminLayout>
|
||||
<div className="flex items-center justify-center min-h-[400px]">
|
||||
<Loader2 className="w-8 h-8 animate-spin" />
|
||||
</div>
|
||||
</>
|
||||
</AdminLayout>
|
||||
);
|
||||
}
|
||||
|
||||
if (!user || !isSuperuser()) {
|
||||
return (
|
||||
<>
|
||||
<AdminHeader />
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
<div className="text-center space-y-4">
|
||||
<h1 className="text-2xl font-bold mb-4">Access Denied</h1>
|
||||
<p className="text-muted-foreground">You don't have permission to access admin settings.</p>
|
||||
{error && (
|
||||
<div className="text-sm text-red-500 p-4 bg-red-50 rounded-md">
|
||||
Error details: {error.message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<AdminLayout>
|
||||
<div className="text-center space-y-4">
|
||||
<h1 className="text-2xl font-bold mb-4">Access Denied</h1>
|
||||
<p className="text-muted-foreground">You don't have permission to access admin settings.</p>
|
||||
{error && (
|
||||
<div className="text-sm text-red-500 p-4 bg-red-50 rounded-md">
|
||||
Error details: {error.message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
</AdminLayout>
|
||||
);
|
||||
}
|
||||
|
||||
if (!settings || settings.length === 0) {
|
||||
return (
|
||||
<>
|
||||
<AdminHeader />
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
<div className="text-center space-y-4">
|
||||
<h1 className="text-2xl font-bold mb-4">No Settings Found</h1>
|
||||
<p className="text-muted-foreground">
|
||||
No admin settings have been configured yet. Please contact your system administrator.
|
||||
</p>
|
||||
{error && (
|
||||
<div className="text-sm text-red-500 p-4 bg-red-50 rounded-md">
|
||||
Error details: {error.message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<AdminLayout>
|
||||
<div className="text-center space-y-4">
|
||||
<h1 className="text-2xl font-bold mb-4">No Settings Found</h1>
|
||||
<p className="text-muted-foreground">
|
||||
No admin settings have been configured yet. Please contact your system administrator.
|
||||
</p>
|
||||
{error && (
|
||||
<div className="text-sm text-red-500 p-4 bg-red-50 rounded-md">
|
||||
Error details: {error.message}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
</AdminLayout>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -431,13 +424,12 @@ export default function AdminSettings() {
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<AdminHeader />
|
||||
<div className="container mx-auto px-4 py-8 max-w-4xl">
|
||||
<div className="mb-8">
|
||||
<h1 className="text-3xl font-bold mb-2">Admin Settings</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Configure system-wide settings and preferences with easy-to-use controls
|
||||
<AdminLayout>
|
||||
<div className="space-y-6 max-w-4xl">
|
||||
<div>
|
||||
<h1 className="text-2xl font-bold tracking-tight">Admin Settings</h1>
|
||||
<p className="text-muted-foreground mt-1">
|
||||
Configure system-wide settings and preferences
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -598,6 +590,6 @@ export default function AdminSettings() {
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
</>
|
||||
</AdminLayout>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user