import { NextResponse } from "next/server";
import { getPushPublicConfig } from "@/lib/push";

/** Public Firebase web config + VAPID key for the client SDK (both are public by design). */
export async function GET() {
  const pub = await getPushPublicConfig();
  if (!pub) return NextResponse.json({ enabled: false });
  return NextResponse.json({ enabled: true, config: pub.config, vapidKey: pub.vapidKey });
}
