import { type NextRequest, NextResponse } from 'next/server' import { getActivityPage } from '@/lib/armory' export const runtime = 'nodejs' export const dynamic = 'force-dynamic' const PAGE_SIZE = 10 /** Actividad reciente paginada + búsqueda (por nombre o ID) para la armería. */ export async function GET(req: NextRequest) { const sp = req.nextUrl.searchParams const guid = Number(sp.get('guid')) const locale = sp.get('locale') === 'en' ? 'en' : 'es' const page = Math.max(1, Number(sp.get('page')) || 1) const q = sp.get('q') || '' if (!guid) return NextResponse.json({ entries: [], total: 0, pageSize: PAGE_SIZE }) const { entries, total } = await getActivityPage(guid, locale, page, PAGE_SIZE, q) return NextResponse.json({ entries, total, pageSize: PAGE_SIZE }) }