/**
 * GET /api/social/ai/history
 * Get AI generation history
 */

import { NextRequest, NextResponse } from "next/server";
import { auth } from "@/lib/auth";
import { logger } from "@/lib/logger";
export async function GET(request: NextRequest) {
  try {
    const session = await auth();
    if (!session?.user?.id) {
      return NextResponse.json(
        { success: false, error: "Unauthorized" },
        { status: 401 },
      );
    }

    // Convex-only — AI history not yet migrated, return empty
    return NextResponse.json({ history: [], success: true });
  } catch (error) {
    logger.error("Failed to get AI history", { error });
    return NextResponse.json(
      { success: false, error: "Failed to get history" },
      { status: 500 },
    );
  }
}
