import { getServerFeatureFlags } from '@/lib/serverFeatureFlags';
import { NextResponse } from 'next/server';

export async function GET() {
  try {
    const featureFlags = await getServerFeatureFlags();
    return NextResponse.json(featureFlags);
  } catch (error) {
    console.error('Error fetching feature flags:', error);
    // Return default flags if there's an error
    return NextResponse.json({
      cardSearch: false,
      urlTypeFilter: false,
      leafletMentions: false,
      animatedLandingTitle: false,
      openCollections: false,
      following: false,
      connections: false,
      graphView: false,
      readerMode: false,
    });
  }
}
