correction npm run build admin
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import ActualitesForm from "@/components/ActualitesForm";
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default function NewActualitesPage() {
|
||||
return <ActualitesForm />;
|
||||
}
|
||||
|
||||
31
admin/src/app/error.tsx
Normal file
31
admin/src/app/error.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
// Log the error to an error reporting service
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center min-h-[400px] p-6 text-center">
|
||||
<h2 className="text-2xl font-bold mb-4">Un problème est survenu !</h2>
|
||||
<p className="text-slate-600 mb-6 max-w-md">
|
||||
Nous sommes désolés, mais une erreur inattendue s'est produite lors du chargement de cette page.
|
||||
</p>
|
||||
<button
|
||||
className="px-6 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors"
|
||||
onClick={() => reset()}
|
||||
>
|
||||
Réessayer
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
25
admin/src/app/global-error.tsx
Normal file
25
admin/src/app/global-error.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
"use client";
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
return (
|
||||
<html lang="fr">
|
||||
<body>
|
||||
<div style={{ padding: '2rem', textAlign: 'center', fontFamily: 'sans-serif' }}>
|
||||
<h2>Une erreur critique est survenue !</h2>
|
||||
<button
|
||||
onClick={() => reset()}
|
||||
style={{ padding: '0.5rem 1rem', marginTop: '1rem', cursor: 'pointer' }}
|
||||
>
|
||||
Réessayer
|
||||
</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
import type { Metadata } from "next";
|
||||
export const dynamic = 'force-dynamic';
|
||||
import { Inter } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import Sidebar from "@/components/Sidebar";
|
||||
import { Toaster } from 'react-hot-toast';
|
||||
|
||||
const inter = Inter({ subsets: ["latin"] });
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "AfroAdmin - Administration Afrohub",
|
||||
@@ -19,10 +14,8 @@ export default function RootLayout({
|
||||
}>) {
|
||||
return (
|
||||
<html lang="fr">
|
||||
<body className={inter.className}>
|
||||
<Toaster position="bottom-right" />
|
||||
<body>
|
||||
<div className="flex min-h-screen">
|
||||
<Sidebar />
|
||||
<main className="admin-content flex-1">
|
||||
{children}
|
||||
</main>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
"use client";
|
||||
|
||||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
@@ -24,13 +23,13 @@ export default function NotFound() {
|
||||
<LayoutDashboard className="w-5 h-5" />
|
||||
Retour au Dashboard
|
||||
</Link>
|
||||
<button
|
||||
onClick={() => window.history.back()}
|
||||
<Link
|
||||
href="/dashboard"
|
||||
className="w-full flex items-center justify-center gap-2 px-6 py-3 bg-slate-900 text-slate-300 border border-slate-800 rounded-xl font-semibold hover:bg-slate-800 transition-colors"
|
||||
>
|
||||
<ArrowLeft className="w-5 h-5" />
|
||||
Page précédente
|
||||
</button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user