import Layout from "@/components/Layout"; import LoadingScreen from "@/components/LoadingScreen"; import { useAuth } from "@/contexts/AuthContext"; import { useEffect, useState } from "react"; import { ensureDemoSeed } from "@/lib/demo-feed"; import { useNavigate } from "react-router-dom"; import { Card, CardContent, CardHeader, CardTitle, CardDescription, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Shield, UserCog, Rocket, Settings, Users, Activity, } from "lucide-react"; export default function Admin() { const { user, loading, roles } = useAuth(); const navigate = useNavigate(); const isOwner = Array.isArray(roles) && roles.includes("owner"); const [demoProfiles, setDemoProfiles] = useState([]); useEffect(() => { try { ensureDemoSeed(); const list = JSON.parse(localStorage.getItem("demo_profiles") || "[]"); setDemoProfiles(Array.isArray(list) ? list : []); } catch { setDemoProfiles([]); } }, []); useEffect(() => { if (!loading) { if (!user) { navigate("/login", { replace: true }); } } }, [user, loading, navigate]); if (loading || !user) { return ( ); } if (!isOwner) { return (
Access Denied You dont have permission to access the admin panel.
); } return (

Admin Panel

Site Owner • Admin • Founder

Site Owner Admin Founder
Access Control
Owner-only access is enforced by email
  • Owner:{" "} mrpiglr@gmail.com
  • All other users are denied access
Users & Roles
Future: manage roles, invitations, and status

Coming soon

Site Settings
Branding, legal, integrations
System Status
Auth, database, and services
  • Auth: Operational
  • Database: Operational (mock fallback available)
  • Realtime: Operational
Quick Actions
Common admin operations
Your Account
Signed in as {user.email}
You have full administrative access.
Demo Accounts
Managed by{" "} mrpiglr@gmail.com
{demoProfiles.length === 0 && (
No demo accounts seeded yet.
)} {demoProfiles.map((p) => (
{p.full_name || p.username}
{p.email}
Managed
))}
); }