Skip to content

[Frontend] Update Dashboard Page with Real Shipment Metrics #580

@mftee

Description

@mftee

Description:
Update the dashboard home page to replace the "—" placeholder metric cards with real data fetched from the shipments API. Add a "Recent Shipments" section below the metrics.

Update frontend/app/(dashboard)/dashboard/page.tsx.

Acceptance Criteria:

  • Fetches user data + shipment stats on mount (parallel requests):
    • shipmentApi.list({ status: 'in_transit', limit: 1 }) → active count
    • shipmentApi.list({ status: 'pending', limit: 1 }) → pending count
    • shipmentApi.list({ status: 'completed', limit: 1 }) → completed count
    • shipmentApi.list({ limit: 4 }) → recent 4 shipments
  • Metric cards show real numbers from the API (fallback "—" while loading)
  • Metric card labels adapt to role: Carriers see "Active Jobs" / "Awaiting Pickup"; Shippers see "Active Shipments" / "Awaiting Carrier"
  • "Recent Shipments" section with "View all →" link; renders <ShipmentCard> for each
  • Empty state in recent section: role-appropriate CTA ("Create your first shipment" for shippers, "Open Marketplace" for carriers)
  • Header CTA button: Shippers see "+ New Shipment" (links to /shipments/new); Carriers see "Browse Marketplace" (links to /marketplace)
  • Sign out button removed from header (now in sidebar)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions