import config from "@payload-config"; import { getPayload } from "payload"; import type { Shipment } from "@/payload-types"; import { TruckIcon } from "lucide-react"; import { ShipmentsList } from "@/components/frontend/logistics/ShipmentsList"; export const metadata = { title: "Shipments: Polaris Task Force", }; export default async function ShipmentsPage() { const payload = await getPayload({ config }); const shipmentsRes = await payload.find({ collection: "shipments", sort: "-dispatchedAt", limit: 100, depth: 2, }); const shipments = shipmentsRes.docs as unknown as Shipment[]; return (

Shipments

{shipments.length} shipment{shipments.length !== 1 ? "s" : ""} tracked.

); }