Files
novalon-website/src/components/ui/back-button.tsx
T
张翔 6403489954 refactor: 完成静态网站转换,移除所有 CMS 和动态功能
- 删除数据库相关代码 (src/db/)
- 删除 API 路由 (src/app/api/)
- 删除认证相关代码 (src/lib/auth/, src/providers/)
- 删除监控和安全中间件 (src/lib/security/, src/lib/monitoring/)
- 删除 hooks (use-news, use-products, use-services)
- 更新组件为静态数据源
- 添加 nginx 静态配置和部署脚本
- 添加 static-link 组件
2026-04-21 07:53:56 +08:00

25 lines
630 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
import { ArrowLeft } from 'lucide-react';
import { Button } from '@/components/ui/button';
/**
* BackButton - 统一的返回按钮组件
*
* 在纯静态导出模式下使用 window.history.back() 替代 Next.js 的 router.back()
* 确保在无服务端路由的环境下正常工作。
*/
export function BackButton() {
return (
<Button
variant="ghost"
size="sm"
className="text-[#5C5C5C] hover:text-[#C41E3A] hover:bg-transparent h-auto py-2 px-3"
onClick={() => window.history.back()}
>
<ArrowLeft className="w-4 h-4 mr-2" />
</Button>
);
}