feat: refactor authentication panels and add AdminOnlyNotice component
This commit is contained in:
11
frontend/src/components/auth/AdminOnlyNotice.tsx
Normal file
11
frontend/src/components/auth/AdminOnlyNotice.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
26
frontend/src/components/auth/SignedOutPanel.tsx
Normal file
26
frontend/src/components/auth/SignedOutPanel.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user