Skip to content

Commit 6cdb83f

Browse files
committed
feat(errors): add Back button to Error Logs page header
- Import useRouter from next/navigation and initialize in ErrorsPage - Add "Back" button with ArrowLeft icon that calls router.back() - Improves navigation and usability when viewing error logs - No breaking changes
1 parent d4bfdbf commit 6cdb83f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/app/errors/page.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
} from "@/components/ui/select";
3131
import { Input } from "@/components/ui/input";
3232
import ErrorIssueGenerator from '@/components/ErrorIssueGenerator';
33+
import { useRouter } from 'next/navigation';
3334

3435
interface ErrorLog {
3536
id: number;
@@ -58,6 +59,7 @@ interface ErrorStats {
5859
}
5960

6061
export default function ErrorsPage() {
62+
const router = useRouter();
6163
const [errors, setErrors] = useState<ErrorLog[]>([]);
6264
const [stats, setStats] = useState<ErrorStats | null>(null);
6365
const [loading, setLoading] = useState(true);
@@ -309,7 +311,18 @@ export default function ErrorsPage() {
309311
return (
310312
<div className="container mx-auto p-4 space-y-4">
311313
<div className="flex justify-between items-center mb-6">
312-
<h1 className="text-3xl font-bold">Error Logs</h1>
314+
<div className="flex items-center gap-4">
315+
<Button
316+
onClick={() => router.back()}
317+
variant="ghost"
318+
size="sm"
319+
className="hover:bg-gray-100 dark:hover:bg-gray-800"
320+
>
321+
<ArrowLeft className="w-4 h-4 mr-2" />
322+
Back
323+
</Button>
324+
<h1 className="text-3xl font-bold">Error Logs</h1>
325+
</div>
313326
<div className="flex gap-2">
314327
<Button onClick={() => handleExport('markdown')} variant="outline">
315328
<Download className="w-4 h-4 mr-2" />

0 commit comments

Comments
 (0)