diff --git a/src/app/api/reports/posts/route.ts b/src/app/api/reports/posts/route.tsx similarity index 71% rename from src/app/api/reports/posts/route.ts rename to src/app/api/reports/posts/route.tsx index 14e7ed0..e902735 100644 --- a/src/app/api/reports/posts/route.ts +++ b/src/app/api/reports/posts/route.tsx @@ -117,45 +117,44 @@ export async function GET(request: Request) { const plainTextResumen = (post.resumen_redes || post.contenido || '').replace(/<[^>]*>?/gm, ' ').replace(/\s+/g, ' ').trim(); const safeResumen = plainTextResumen.length > 120 ? plainTextResumen.substring(0, 120) + '...' : plainTextResumen; - // WAIT! This file is route.ts, JSX is not supported in .ts unless it's .tsx! - // Let's use react.createElement - const React = require('react'); - const cardNode = React.createElement('div', { - style: { - display: 'flex', flexDirection: 'column', width: 600, height: 600, - backgroundColor: '#0f172a', borderRadius: 24, - overflow: 'hidden', border: '1px solid rgba(255,255,255,0.1)', fontFamily: 'sans-serif' - } - }, - React.createElement('div', { - style: { display: 'flex', width: 600, height: 337, backgroundColor: '#1e293b', position: 'relative' } - }, - imageUrl - ? React.createElement('img', { src: imageUrl, style: { width: 600, height: 337, objectFit: 'cover' } }) - : React.createElement('div', { style: { width: 600, height: 337, display: 'flex', alignItems: 'center', justifyContent: 'center' } }, - React.createElement('span', { style: { color: '#475569', fontSize: 24, fontWeight: 900, textTransform: 'uppercase', letterSpacing: 4 } }, 'Almeira Web') - ), - React.createElement('div', { style: { position: 'absolute', top: 16, left: 16, display: 'flex' } }, - React.createElement('span', { - style: { padding: '6px 12px', borderRadius: 9999, fontSize: 12, fontWeight: 'bold', letterSpacing: 1, backgroundColor: 'rgba(0,0,0,0.6)', color: '#67e8f9', border: '1px solid rgba(255,255,255,0.2)' } - }, 'NOTICIA') - ) + // Use native JSX now that the file is renamed to route.tsx + const cardImage = new ImageResponse( + ( +
{safeResumen}
+