import { NextResponse } from 'next/server';
import { getCloseBotClient } from '@/lib/closebot';

export async function GET() {
  try {
    const client = getCloseBotClient();
    if (!client.isConfigured) {
      return NextResponse.json([]);
    }
    const sources = await client.listSources();
    return NextResponse.json(sources);
  } catch (err) {
    console.error('Failed to list CloseBot sources:', err);
    return NextResponse.json([], { status: 200 });
  }
}
