import { redirect } from "next/navigation";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import AdminPageHeader from "@/components/admin/admin-page-header";
import { auth } from "@/lib/auth";

export default async function AdminPage() {
  const session = await auth();

  if (!session?.user) {
    redirect("/admin/login");
  }

  return (
    <div className="mx-auto w-full max-w-7xl">
      <AdminPageHeader
        title="Dashboard"
        description="Manage the content that will power the public website."
      />

      <section aria-label="Workspace overview" className="grid gap-4 md:grid-cols-3">
        <Card>
          <CardHeader>
            <CardTitle className="text-base">Signed-in account</CardTitle>
          </CardHeader>
          <CardContent>
            <p className="truncate text-sm text-muted-foreground">{session.user.email}</p>
          </CardContent>
        </Card>
        <Card>
          <CardHeader>
            <CardTitle className="text-base">Content status</CardTitle>
          </CardHeader>
          <CardContent>
            <p className="text-sm text-muted-foreground">Coming soon mode is active.</p>
          </CardContent>
        </Card>
        <Card>
          <CardHeader>
            <CardTitle className="text-base">Next step</CardTitle>
          </CardHeader>
          <CardContent>
            <p className="text-sm text-muted-foreground">Categories and content tools are next.</p>
          </CardContent>
        </Card>
      </section>
    </div>
  );
}
