Harden form auth and submission handling
This commit is contained in:
+11
-16
@@ -3,28 +3,23 @@
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import Background from "@/public/404.png";
|
||||
import Profile from "@/public/404-image.jpg";
|
||||
import { Activity, Home } from "lucide-react";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
|
||||
const MESSAGES = [
|
||||
"Erika กินหน้านี้ไปแล้ว...",
|
||||
"หรือจริงๆแล้วหน้านี้จะโดน Sukuna เล่น...",
|
||||
"อาจจะโดนต่อยจากคนด้านบนแล้วก็ได้...",
|
||||
"หรือ Erika ตัวปลอมขะมีอยู่จริง...",
|
||||
"หน้านี้อาจโดนErikaตัวปลอมทำลายไปแล้วนะ...",
|
||||
];
|
||||
|
||||
export default function NotFound() {
|
||||
const [goingHome, goHome] = useState(false);
|
||||
const [message, setMessage] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
const messages = [
|
||||
"Erika กินหน้านี้ไปแล้ว...",
|
||||
"หรือจริงๆแล้วหน้านี้จะโดน Sukuna เล่น...",
|
||||
"อาจจะโดนต่อยจากคนด้านบนแล้วก็ได้...",
|
||||
"หรือ Erika ตัวปลอมขะมีอยู่จริง...",
|
||||
"หน้านี้อาจโดนErikaตัวปลอมทำลายไปแล้วนะ...",
|
||||
];
|
||||
|
||||
setMessage(messages[Math.floor(Math.random() * messages.length)]);
|
||||
}, []);
|
||||
const [message] = useState(() => MESSAGES[Math.floor(Math.random() * MESSAGES.length)]);
|
||||
|
||||
return (
|
||||
<div className="flex min-h-screen w-full flex-col items-center justify-center gap-2 bg-[#2225] backdrop-blur-md backdrop-grayscale">
|
||||
@@ -45,7 +40,7 @@ export default function NotFound() {
|
||||
/>
|
||||
</div>
|
||||
<h2 className="text-2xl font-semibold">404 ไม่พบหน้านี้</h2>
|
||||
<span>{message || <Skeleton className="h-6 w-40" />}</span>
|
||||
<span>{message}</span>
|
||||
<div className="flex gap-2">
|
||||
<Link href="/">
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user