import type { ShipmentStatus } from "@mrp/shared/dist/shipping/types.js";

import { shipmentStatusOptions, shipmentStatusPalette } from "./config";

export function ShipmentStatusBadge({ status }: { status: ShipmentStatus }) {
  const label = shipmentStatusOptions.find((option) => option.value === status)?.label ?? status;
  return <span className={`inline-flex rounded-full px-2 py-1 text-xs font-semibold ${shipmentStatusPalette[status]}`}>{label}</span>;
}
