fix build

This commit is contained in:
songtianlun 2025-06-14 02:59:31 +08:00
parent 7ffe8898d9
commit fae9eebb03

View File

@ -5,6 +5,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
import { Button } from "@/components/ui/button"
import { AlertTriangle, ArrowLeft } from "lucide-react"
import Link from "next/link"
import { Suspense } from "react"
const errorMessages: Record<string, string> = {
Configuration: "服务器配置错误",
@ -13,46 +14,63 @@ const errorMessages: Record<string, string> = {
Default: "登录时发生错误",
}
export default function AuthErrorPage() {
function AuthErrorContent() {
const searchParams = useSearchParams()
const error = searchParams.get("error")
const errorMessage = error && errorMessages[error] ? errorMessages[error] : errorMessages.Default
return (
<Card className="w-full max-w-md">
<CardHeader className="space-y-1 text-center">
<div className="flex justify-center mb-4">
<AlertTriangle className="h-12 w-12 text-red-500" />
</div>
<CardTitle className="text-2xl"></CardTitle>
<CardDescription>
{errorMessage}
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="text-sm text-muted-foreground text-center">
<p></p>
{error && (
<p className="mt-2">: {error}</p>
)}
</div>
<div className="flex gap-2">
<Button asChild variant="outline" className="flex-1">
<Link href="/">
<ArrowLeft className="mr-2 h-4 w-4" />
</Link>
</Button>
<Button asChild className="flex-1">
<Link href="/auth/signin">
</Link>
</Button>
</div>
</CardContent>
</Card>
)
}
export default function AuthErrorPage() {
return (
<div className="min-h-screen flex items-center justify-center bg-gray-50">
<Card className="w-full max-w-md">
<CardHeader className="space-y-1 text-center">
<div className="flex justify-center mb-4">
<AlertTriangle className="h-12 w-12 text-red-500" />
</div>
<CardTitle className="text-2xl"></CardTitle>
<CardDescription>
{errorMessage}
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<div className="text-sm text-muted-foreground text-center">
<p></p>
{error && (
<p className="mt-2">: {error}</p>
)}
</div>
<div className="flex gap-2">
<Button asChild variant="outline" className="flex-1">
<Link href="/">
<ArrowLeft className="mr-2 h-4 w-4" />
</Link>
</Button>
<Button asChild className="flex-1">
<Link href="/auth/signin">
</Link>
</Button>
</div>
</CardContent>
</Card>
<Suspense fallback={
<Card className="w-full max-w-md">
<CardHeader className="space-y-1 text-center">
<div className="flex justify-center mb-4">
<AlertTriangle className="h-12 w-12 text-red-500" />
</div>
<CardTitle className="text-2xl">...</CardTitle>
</CardHeader>
</Card>
}>
<AuthErrorContent />
</Suspense>
</div>
)
}