import type { ReactNode } from 'react';
import { motion } from 'motion/react';
import { AlertTriangle, Compass, Home, RotateCw } from 'lucide-react';
import { Button } from '@/components/ui/button';
type Tone = 'primary' | 'destructive';
function StatusShell({
tone,
icon,
code,
title,
description,
children,
}: {
tone: Tone;
icon: ReactNode;
code?: string;
title: string;
description: string;
children: ReactNode;
}) {
return (
{icon}
{code && (
{code}
)}
{title}
{description}
{children}
);
}
/** Rendered by the router for any unmatched path. */
export function NotFoundPage() {
return (
}
code="404"
title="页面不存在"
description="你访问的地址没有对应的页面,可能链接已失效或输入有误。"
>
);
}
/** Rendered by the router when a route component throws while rendering. */
export function ErrorPage({ error, reset }: { error?: Error; reset?: () => void }) {
const message = error?.message?.trim();
return (
}
title="页面出错了"
description="渲染该页面时发生了意外错误。可以重试,或返回首页继续操作。"
>
{reset && (
)}
{message && (
{message}
)}
);
}