feat: CSV export endpoint for HSE and management dashboards

This commit is contained in:
2026-07-11 18:44:52 +08:00
parent b6845f5bb5
commit dfca872629
3 changed files with 104 additions and 4 deletions
+11 -3
View File
@@ -109,9 +109,17 @@ export default async function HseDashboardPage() {
<main className="max-w-4xl mx-auto px-4 py-6">
<div className="flex items-center justify-between mb-6">
<h1 className="text-2xl font-bold text-gray-900">Dashboard</h1>
<Link href="/hse/incidents" className="text-sm text-blue-600 hover:underline">
View all incidents
</Link>
<div className="flex gap-3">
<a
href="/api/dashboard/export?role=hse"
className="text-sm text-gray-500 hover:text-gray-700 border border-gray-200 rounded-lg px-3 py-1.5"
>
Export CSV
</a>
<Link href="/hse/incidents" className="text-sm text-blue-600 hover:underline">
View all incidents
</Link>
</div>
</div>
{/* Summary stats */}