import { NextResponse } from 'next/server';
import { getPublicStatus } from '@/lib/public-status';

export async function GET() {
  try {
    const status = await getPublicStatus();
    return NextResponse.json(status, {
      headers: { 'Cache-Control': 'public, s-maxage=15, stale-while-revalidate=30' }
    });
  } catch (error) {
    console.error('[public/status]', error);
    return NextResponse.json({ error: 'Failed to load status' }, { status: 500 });
  }
}
