feat: refactor authentication panels and add AdminOnlyNotice component

This commit is contained in:
Abhimanyu Saharan
2026-02-08 23:30:24 +05:30
parent 03317f0baf
commit 86d93d94fe
6 changed files with 69 additions and 58 deletions

View File

@@ -0,0 +1,11 @@
type AdminOnlyNoticeProps = {
message: string;
};
export function AdminOnlyNotice({ message }: AdminOnlyNoticeProps) {
return (
<div className="rounded-xl border border-slate-200 bg-white px-6 py-5 text-sm text-slate-600 shadow-sm">
{message}
</div>
);
}

View File

@@ -0,0 +1,26 @@
import { SignInButton } from "@/auth/clerk";
import { Button } from "@/components/ui/button";
type SignedOutPanelProps = {
message: string;
forceRedirectUrl: string;
buttonLabel?: string;
};
export function SignedOutPanel({
message,
forceRedirectUrl,
buttonLabel = "Sign in",
}: SignedOutPanelProps) {
return (
<div className="col-span-2 flex min-h-[calc(100vh-64px)] items-center justify-center bg-slate-50 p-10 text-center">
<div className="rounded-xl border border-slate-200 bg-white px-8 py-6 shadow-sm">
<p className="text-sm text-slate-600">{message}</p>
<SignInButton mode="modal" forceRedirectUrl={forceRedirectUrl}>
<Button className="mt-4">{buttonLabel}</Button>
</SignInButton>
</div>
</div>
);
}