import { NextResponse } from "next/server";
import { requireAdminApiUser } from "@/lib/auth/admin";
import { listLegalTemplates } from "@/lib/legal/ai-documents";

export async function GET() {
  const user = await requireAdminApiUser();

  if (!user) {
    return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
  }

  return NextResponse.json({ ok: true, templates: listLegalTemplates() });
}
