import { NextResponse } from "next/server";
import { readDb } from "@/lib/store";

export async function GET() {
  const db = await readDb();
  return NextResponse.json({
    ok: true,
    pinDrafts: db.pinDrafts.filter((pin) => pin.status === "pending_review"),
    tasks: db.tasks.filter((task) => task.status === "pending"),
    leads: db.leads.filter((lead) => lead.status === "new" || lead.status === "reviewing"),
  });
}
