import { redirect } from "next/navigation";
import { getTemplates, getAdminUsers } from "@/lib/server-data";
import { AdminClient } from "@/components/AdminClient";

export default async function AdminPage() {
  const [templates, users] = await Promise.all([getTemplates(), getAdminUsers()]);
  if (!users) redirect("/auth/login");

  return <AdminClient templates={templates} users={users} />;
}
