Dental Care

This commit is contained in:
Iliyan Angelov
2025-11-16 14:29:51 +02:00
commit 39077550ef
194 changed files with 43197 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import { Button } from "@/components/ui/button";
import Link from "next/link";
import { getCurrentUser } from "@/lib/auth-session/auth-server";
import { redirect } from "next/navigation";
export default async function ForbiddenPage() {
const user = await getCurrentUser();
// If not authenticated, redirect to sign-in
if (!user) {
redirect("/sign-in");
}
// Determine the appropriate dashboard based on role
const getDashboardUrl = () => {
switch (user.role) {
case "admin":
return "/admin";
case "dentist":
return "/dentist";
case "patient":
return "/patient";
default:
return "/profile";
}
};
return (
<main className="flex grow items-center justify-center px-4 text-center">
<div className="space-y-6">
<div className="space-y-2">
<h1 className="text-4xl font-bold">403</h1>
<h2 className="text-2xl font-semibold">Access Denied</h2>
<p className="text-muted-foreground">
You don&apos;t have permission to access this page.
</p>
</div>
<div className="flex gap-4 justify-center">
<Button asChild variant="default">
<Link href={getDashboardUrl()}>Go to Dashboard</Link>
</Button>
<Button asChild variant="outline">
<Link href="/">Go Home</Link>
</Button>
</div>
</div>
</main>
);
}

View File

@@ -0,0 +1,25 @@
"use client";
import { Button } from "@/components/ui/button";
import Link from "next/link";
import { usePathname } from "next/navigation";
export default function UnauthorizedPage() {
const pathname = usePathname();
return (
<main className="flex grow items-center justify-center px-4 text-center">
<div className="space-y-6">
<div className="space-y-2">
<h1 className="text-2xl font-semibold">401 - Unauthorized</h1>
<p className="text-muted-foreground">Please sign in to continue.</p>
</div>
<div>
<Button asChild>
<Link href={`/sign-in?redirect=${pathname}`}>Sign in</Link>
</Button>
</div>
</div>
</main>
);
}