integratedhub/routes/unauthorized.tsx
2026-02-14 02:20:19 +00:00

45 lines
1.5 KiB
TypeScript

import { define } from "../utils.ts";
export default define.page((ctx) => {
const url = new URL(ctx.req.url);
const required = url.searchParams.get("required") || "";
const current = url.searchParams.get("current") || "";
return (
<div class="min-h-screen bg-gray-50 flex items-center justify-center px-6">
<div class="max-w-lg w-full bg-white shadow rounded-lg p-8 text-center">
<h1 class="text-2xl font-bold text-gray-900 mb-4">
Access Restricted
</h1>
<p class="text-gray-600 mb-6">
Your account does not have the required access for this page.
</p>
{required && (
<p class="text-sm text-gray-500 mb-2">
Required role: <span class="font-semibold">{required}</span>
</p>
)}
{current && (
<p class="text-sm text-gray-500 mb-6">
Your role: <span class="font-semibold">{current}</span>
</p>
)}
<div class="flex flex-col gap-3">
<a
href="/onboarding"
class="inline-flex justify-center rounded-md bg-blue-600 px-4 py-2 text-white text-sm font-medium hover:bg-blue-700"
>
Go to Onboarding
</a>
<a
href="/"
class="inline-flex justify-center rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"
>
Return Home
</a>
</div>
</div>
</div>
);
});