diff --git a/src/app/clasificados/page.tsx b/src/app/clasificados/page.tsx
index 3f5bc07..2a75d76 100644
--- a/src/app/clasificados/page.tsx
+++ b/src/app/clasificados/page.tsx
@@ -132,7 +132,7 @@ export default async function ClasificadosPage() {
) : (
- {posts.map((post) => {
+ {posts.map((post: 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;
diff --git a/src/app/error.tsx b/src/app/error.tsx
new file mode 100644
index 0000000..895ef6d
--- /dev/null
+++ b/src/app/error.tsx
@@ -0,0 +1,32 @@
+'use client'
+
+import { useEffect } from 'react'
+
+export default function Error({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string }
+ reset: () => void
+}) {
+ useEffect(() => {
+ // Solo redirigir si no estamos ya en el dominio de respaldo para evitar bucles infinitos
+ if (typeof window !== 'undefined' && window.location.hostname !== 'news.almeira.co') {
+ window.location.href = 'https://news.almeira.co';
+ }
+ }, [error]);
+
+ return (
+
+
SEÑAL INTERRUMPIDA
+
+ Hemos detectado una anomalía en este servidor. Redirigiendo automáticamente a nuestro portal de respaldo...
+
+
+
+
+ Ir manualmente
+
+
+ )
+}
diff --git a/src/app/eventos/page.tsx b/src/app/eventos/page.tsx
index e547f8c..bf46011 100644
--- a/src/app/eventos/page.tsx
+++ b/src/app/eventos/page.tsx
@@ -132,7 +132,7 @@ export default async function EventosPage() {
) : (
- {posts.map((post) => {
+ {posts.map((post: 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;
diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx
new file mode 100644
index 0000000..5d888ab
--- /dev/null
+++ b/src/app/global-error.tsx
@@ -0,0 +1,45 @@
+'use client'
+
+export default function GlobalError({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string }
+ reset: () => void
+}) {
+ return (
+
+
+
+
+
+
+
SEÑAL CRÍTICA INTERRUMPIDA
+
+ Fallo mayor en la transmisión principal. Reencaminando el tráfico a nuestro servidor secundario...
+
+
+
+
+ Ir a news.almeira.co
+
+
+
+
+
+
+ )
+}
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 0334c86..b0b5185 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -212,7 +212,7 @@ export default async function Home(props: { searchParams: Promise<{ [key: string
) : (
- {posts.map((post) => {
+ {posts.map((post: 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;
diff --git a/src/components/NewsCard.tsx b/src/components/NewsCard.tsx
index 4a10937..182d286 100644
--- a/src/components/NewsCard.tsx
+++ b/src/components/NewsCard.tsx
@@ -34,7 +34,10 @@ export const NewsCard = ({
imageAspect = 'aspect-[16/10]'
}: NewsCardProps) => {
const titulo = decodeHtmlEntities(rawTitulo);
- const resumen = decodeHtmlEntities(rawResumen);
+
+ // Strip HTML tags safely for a plain text excerpt
+ const plainTextResumen = (rawResumen || '').replace(/<[^>]*>?/gm, ' ').replace(/\s+/g, ' ').trim();
+ const resumen = decodeHtmlEntities(plainTextResumen);
// Formatear fecha
const fechaObj = new Date(fecha);
@@ -62,9 +65,14 @@ export const NewsCard = ({
{/* Imagen Destacada */}
-
+
{imagenUrl ? (
-

+ <>
+ {/* Blurred Background to fill empty spaces nicely */}
+

+ {/* Main Image contained properly without crop */}
+

+ >
) : (
{/* No placeholder text as per user request */}
@@ -73,14 +81,12 @@ export const NewsCard = ({
{/* Badge/Tag - Habilitable por prop */}
{showCategory && (
-
+
{tipo?.toUpperCase() || 'NOTICIA'}
)}
-
- {/* No button here */}
{/* Contenido */}
diff --git a/src/lib/appwrite.server.ts b/src/lib/appwrite.server.ts
index 2338f1e..01cf4b3 100644
--- a/src/lib/appwrite.server.ts
+++ b/src/lib/appwrite.server.ts
@@ -71,8 +71,7 @@ export async function createAdminClient() {
patchClientInstance(client);
- const keyPrefix = process.env.APPWRITE_API_KEY ? process.env.APPWRITE_API_KEY.trim().substring(0, 15) + '...' : 'EMPTY_KEY';
- console.log('Admin Client initialized with key:', keyPrefix, 'Length:', process.env.APPWRITE_API_KEY?.length);
+
return {
get account() {