MCPcopy Create free account
hub / github.com/IamIsPra/tinywebp / NotFound

Function NotFound

src/pages/NotFound.tsx:7–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5import { Ghost, ArrowLeftCircle } from 'lucide-react';
6
7const NotFound: React.FC = () => {
8 const [theme, setTheme] = useState<'light' | 'dark'>(
9 localStorage.getItem('theme') as 'light' | 'dark' ||
10 (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
11 );
12
13 useEffect(() => {
14 document.documentElement.classList.toggle('dark', theme === 'dark');
15 localStorage.setItem('theme', theme);
16 }, [theme]);
17
18 const toggleTheme = () => {
19 setTheme(prev => prev === 'light' ? 'dark' : 'light');
20 };
21
22 return (
23 <div className="min-h-screen flex flex-col bg-gradient-to-b from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800">
24 <Header theme={theme} toggleTheme={toggleTheme} />
25
26 <main className="flex-1 flex flex-col items-center justify-center text-center px-4 pt-28">
27 <Ghost className="w-24 h-24 text-gray-400 dark:text-gray-600 animate-bounce" />
28 <h1 className="text-6xl font-extrabold text-gray-900 dark:text-white mt-6">404</h1>
29 <p className="text-xl text-gray-600 dark:text-gray-300 mt-2">Oops! The page you're looking for doesn't exist.</p>
30 <Link
31 to="/"
32 className="mt-6 inline-flex items-center gap-2 px-6 py-3 bg-gray-800 text-white dark:bg-gray-600 text-lg font-semibold rounded-lg shadow-md hover:bg-blue-700 transition-all"
33 >
34 <ArrowLeftCircle className="w-5 h-5" /> Go Home
35 </Link>
36 </main>
37
38 <Footer />
39 </div>
40 );
41};
42
43export default NotFound;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected