From f71879da9c799432d07186eeb18a6d379edf943f Mon Sep 17 00:00:00 2001 From: "Carlos (Almeira)" Date: Thu, 26 Mar 2026 15:56:38 -0500 Subject: [PATCH] Refactor: Full-width support for Clasificados --- src/app/clasificados/page.tsx | 104 +++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 46 deletions(-) diff --git a/src/app/clasificados/page.tsx b/src/app/clasificados/page.tsx index 6242429..33bf96f 100644 --- a/src/app/clasificados/page.tsx +++ b/src/app/clasificados/page.tsx @@ -2,6 +2,7 @@ import { APPWRITE_ALMEIRA_CONFIG } from '@/lib/appwrite'; import { createAdminClient } from '@/lib/appwrite.server'; import { Query } from 'node-appwrite'; import { NewsCard } from '@/components/NewsCard'; +import { GlobalSidebar, hasSidebarContent } from '@/components/AdWrappers'; import { Sparkles } from 'lucide-react'; async function fetchClasificadosData() { @@ -56,6 +57,7 @@ async function fetchClasificadosData() { export default async function ClasificadosPage() { const { posts, cardSettings } = await fetchClasificadosData(); + const hasSidebar = await hasSidebarContent(); return (
@@ -84,55 +86,65 @@ export default async function ClasificadosPage() { -
-
-
-
-
- Avisos -
-

Anuncios Recientes

-
-
- - {posts.length === 0 ? ( -
-
- +
+
+
+
+
+
+
+ Avisos +
+

Anuncios Recientes

+
-

Sin Anuncios Recientes

-

El mercado se encuentra a la espera de nuevas ofertas globales.

-
- ) : ( -
- {posts.map((post) => { - const PROJECT_ID = process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID || '69b84df5003bd8957c5c'; - const ENDPOINT = process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT || 'https://appwrite.almeira.com.co/v1'; - let imagenUrl = post.og_image_url || null; - if (post.resolved_media) { - imagenUrl = `${ENDPOINT}/storage/buckets/${post.resolved_media.bucket_id}/files/${post.resolved_media.file_id}/preview?project=${PROJECT_ID}&width=800&height=500&quality=85`; - } + {posts.length === 0 ? ( +
+
+ +
+

Sin Anuncios Recientes

+

El mercado se encuentra a la espera de nuevas ofertas globales.

+
+ ) : ( +
+ {posts.map((post) => { + const PROJECT_ID = process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID || '69b84df5003bd8957c5c'; + const ENDPOINT = process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT || 'https://appwrite.almeira.com.co/v1'; + let imagenUrl = post.og_image_url || null; - return ( - ]*>?/gm, '').substring(0, 150) + '...'} - tipo="Aviso" - fecha={post.fecha_publicacion || post.$createdAt} - imagenUrl={imagenUrl} - showCategory={cardSettings.showCategory} - showFooterDate={cardSettings.showFooterDate} - showFooterButton={cardSettings.showFooterButton} - footerText={cardSettings.footerText} - /> - ) - })} -
- )} + if (post.resolved_media) { + imagenUrl = `${ENDPOINT}/storage/buckets/${post.resolved_media.bucket_id}/files/${post.resolved_media.file_id}/preview?project=${PROJECT_ID}&width=800&height=500&quality=85`; + } + + return ( + ]*>?/gm, '').substring(0, 150) + '...'} + tipo="Aviso" + fecha={post.fecha_publicacion || post.$createdAt} + imagenUrl={imagenUrl} + showCategory={cardSettings.showCategory} + showFooterDate={cardSettings.showFooterDate} + showFooterButton={cardSettings.showFooterButton} + footerText={cardSettings.footerText} + /> + ) + })} +
+ )} +
+ + {hasSidebar && ( + + )} +
);