From 0f4cee1cf13c531a81a1021dae8a2e3d0985831c Mon Sep 17 00:00:00 2001 From: Atul Gunjal Date: Wed, 23 Apr 2025 08:39:06 +0530 Subject: [PATCH] solved "not found" build error. --- src/app/layout.js | 2 +- src/app/not-found.js | 66 +++++++++++++++++++++++++++++++ src/app/not-found/page.js | 74 ----------------------------------- src/app/pages/entries/page.js | 12 +++--- 4 files changed, 73 insertions(+), 81 deletions(-) create mode 100644 src/app/not-found.js delete mode 100644 src/app/not-found/page.js diff --git a/src/app/layout.js b/src/app/layout.js index c5ebf23..f53d693 100644 --- a/src/app/layout.js +++ b/src/app/layout.js @@ -5,7 +5,7 @@ import { AuthProvider } from "./context/AuthContext"; import ClientLayout from "./ClientLayout"; export const metadata = { - title: "Report Management System", + title: "PatientPro", description: "Generated by create next app", }; diff --git a/src/app/not-found.js b/src/app/not-found.js new file mode 100644 index 0000000..3f61aba --- /dev/null +++ b/src/app/not-found.js @@ -0,0 +1,66 @@ +// app/not-found.js (not in a 'page.js' file) +"use client"; // Add this since you're using client-side features + +import Link from "next/link"; +import Image from "next/image"; +import { useEffect } from "react"; + +export default function NotFound() { + useEffect(() => { + // Client-side dark mode initialization + const darkMode = JSON.parse(localStorage.getItem('darkMode')); + if (darkMode) { + document.documentElement.classList.add('dark'); + document.documentElement.classList.add('bg-gray-900'); + } + }, []); + + return ( +
+ {/* Metadata - App Router style */} + 404 Error Page | TailAdmin + + + {/* Centered Content */} +
+

+ ERROR +

+ + {/* Optimized Images */} + 404 + 404 + +

+ We can't seem to find the page you are looking for! +

+ + + Back to Home Page + +
+ + {/* Footer */} +

+ © {new Date().getFullYear()} - TailAdmin +

+
+ ); +} \ No newline at end of file diff --git a/src/app/not-found/page.js b/src/app/not-found/page.js deleted file mode 100644 index dca63c9..0000000 --- a/src/app/not-found/page.js +++ /dev/null @@ -1,74 +0,0 @@ -import Link from "next/link"; -import Head from "next/head"; -import Image from "next/image"; - -export default function NotFound() { - return ( - <> - - 404 Error Page | TailAdmin - - - - -
- {/* Centered Content */} -
-

- ERROR -

- - {/* Optimized Images */} - 404 - 404 - -

- We can't seem to find the page you are looking for! -

- - - Back to Home Page - -
- - {/* Footer */} -

- © {new Date().getFullYear()} - TailAdmin -

-
- - {/* Initialize dark mode with vanilla JS */} -