feat: ( reports ) add fleet seat overview to seat status landing page

This commit is contained in:
Abubeker Yasin
2026-08-13 15:32:56 +03:00
parent 1e97f46813
commit aabf58320a
4 changed files with 872 additions and 7 deletions

View File

@@ -2,8 +2,9 @@
import { useState } from "react";
import { useQuery } from "@tanstack/react-query";
import { CheckCircle, Clock, AlertCircle, Ban, Armchair, Download } from "lucide-react";
import { CheckCircle, Clock, AlertCircle, Ban, Download } from "lucide-react";
import { apiClient } from "@/lib/api-client";
import FleetSeatOverview from "@/components/reports/FleetSeatOverview";
import Badge from "@/components/ui/Badge";
import ActionButton from "@/components/ui/ActionButton";
import { formatDateTime, formatCurrency } from "@/lib/utils";
@@ -165,12 +166,9 @@ export default function SeatStatusReportPage() {
{isError && <p className="text-xs text-red-500 mt-2">Failed to load report.</p>}
</div>
{!scheduleId && (
<div className="card py-16 text-center text-muted-foreground">
<Armchair className="h-10 w-10 mx-auto mb-3 opacity-30" />
<p>Select a schedule above to load the seat status report</p>
</div>
)}
{/* Landing state only. Unmounts the moment a schedule is selected, leaving the
per-schedule report below untouched. */}
{!scheduleId && <FleetSeatOverview onSelectSchedule={setScheduleId} />}
{data && (
<>