refactor: update disabled form UI to use Card component and remove redundant Toaster from layout

This commit is contained in:
2026-05-28 20:30:25 +07:00 Unverified
parent bc78873ff8
commit dedf92965b
2 changed files with 8 additions and 6 deletions
+8 -4
View File
@@ -185,10 +185,14 @@ export function FormFillerClient({ form, questions, initialAnswers = {} }: FormF
return (
<div className="relative">
{!form.isOpen && (
<div className="absolute inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm rounded-xl">
<div className="bg-background border shadow-lg p-6 rounded-lg">
<h2 className="text-xl font-bold text-center">This form disable for now</h2>
</div>
<div className="fixed inset-0 z-50 flex items-center justify-center bg-background/50 backdrop-blur-sm p-4">
<Card className="w-full max-w-sm">
<CardHeader>
<CardTitle className="text-center text-xl">
This form is disabled for now
</CardTitle>
</CardHeader>
</Card>
</div>
)}
<form onSubmit={handleSubmit} className="space-y-6">
-2
View File
@@ -1,6 +1,5 @@
import { getServerSession } from "next-auth";
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
import { Toaster } from "@/components/ui/sonner";
import { FormLayoutClient } from "./client";
import LoginDialog from "@/components/login-dialog";
@@ -25,7 +24,6 @@ export default async function FormLayout({
)}
</header>
<main className="flex-1">{children}</main>
<Toaster />
{!session && <LoginDialog />}
</div>
);