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 ( + + +