|
| 1 | +import { Logo } from "@/components/logo"; |
| 2 | +import { Button } from "@/components/ui/button"; |
| 3 | +import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; |
| 4 | +import AuthorizedApolloWrapper from "@/providers/use-apollo.rsc"; |
| 5 | +import { AlertTriangle } from "lucide-react"; |
| 6 | +import Link from "next/link"; |
| 7 | +import { Suspense } from "react"; |
| 8 | +import { UserInfo } from "./user-info"; |
| 9 | + |
| 10 | +export default async function ForbiddenLayout() { |
| 11 | + return ( |
| 12 | + <div |
| 13 | + className={` |
| 14 | + flex min-h-svh flex-col items-center justify-center gap-6 |
| 15 | + bg-gradient-to-br from-red-50 via-white to-red-100 p-6 |
| 16 | + md:p-10 |
| 17 | + `} |
| 18 | + > |
| 19 | + <Link |
| 20 | + href="/" |
| 21 | + className={`flex items-center gap-2 self-center font-medium`} |
| 22 | + > |
| 23 | + <div |
| 24 | + className={` |
| 25 | + flex size-6 items-center justify-center rounded-md |
| 26 | + text-primary-foreground |
| 27 | + `} |
| 28 | + > |
| 29 | + <Logo /> |
| 30 | + </div> |
| 31 | + 資料庫練功坊 |
| 32 | + </Link> |
| 33 | + <Card className="min-w-md"> |
| 34 | + <CardHeader className="flex w-full flex-col items-center text-center"> |
| 35 | + <AlertTriangle className="mb-2 size-7 text-red-500" /> |
| 36 | + <CardTitle className="text-xl">無權開啟此頁面</CardTitle> |
| 37 | + <CardDescription> |
| 38 | + 您的帳號尚未開通,無法使用系統。請聯絡管理員開通帳號。 |
| 39 | + </CardDescription> |
| 40 | + </CardHeader> |
| 41 | + <CardContent className="flex flex-col items-center gap-4"> |
| 42 | + <Button asChild variant="outline"> |
| 43 | + <Link href="/login">重新登入</Link> |
| 44 | + </Button> |
| 45 | + </CardContent> |
| 46 | + <CardFooter |
| 47 | + className={`justify-center text-center text-xs text-muted-foreground`} |
| 48 | + > |
| 49 | + <Suspense> |
| 50 | + <AuthorizedApolloWrapper> |
| 51 | + <UserInfo /> |
| 52 | + </AuthorizedApolloWrapper> |
| 53 | + </Suspense> |
| 54 | + </CardFooter> |
| 55 | + </Card> |
| 56 | + </div> |
| 57 | + ); |
| 58 | +} |
0 commit comments