import { NextRequest, NextResponse } from 'next/server' export async function GET( request: NextRequest, { params }: { params: Promise<{ params: string[] }> } ) { try { const resolvedParams = await params const [width, height] = resolvedParams.params[0]?.split('/') || ['400', '400'] const searchParams = request.nextUrl.searchParams const text = searchParams.get('text') || 'Image' // Создаем простое SVG изображение const svg = ` ${text} ${width}x${height} ` return new NextResponse(svg, { headers: { 'Content-Type': 'image/svg+xml', 'Cache-Control': 'public, max-age=31536000' } }) } catch (error) { console.error('Placeholder API error:', error) // Возвращаем простое SVG в случае ошибки const svg = ` No Image ` return new NextResponse(svg, { headers: { 'Content-Type': 'image/svg+xml' } }) } }