Skip to content

[Frontend] Build Shipments List Page with Status Filter Tabs #576

@mftee

Description

@mftee

Description:
Build the main shipments list page that shows the authenticated user's shipments (role-filtered by the backend). Include tabbed filtering by status and a "New Shipment" button for shippers.

Create frontend/app/(dashboard)/shipments/page.tsx.

Acceptance Criteria:

  • 'use client' directive
  • Fetches shipments via shipmentApi.list({ status }) on mount and on tab change
  • Status tabs: All, Pending, Accepted, In Transit, Delivered, Completed (horizontal tab row with bottom border indicator)
  • Shows loading skeleton (4 animated pulse cards) while fetching
  • Shows empty state when no results — with "Create your first shipment" CTA for shippers if "All" tab is selected
  • Renders a <ShipmentCard> per shipment in a responsive grid (1 col mobile, 2 col sm+)
  • Shows total count below the grid: "Showing X of Y shipments"
  • "New Shipment" button (top right) visible only to shippers / admins
  • Uses toast.error() on fetch failure

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