/**
 * 採購單狀態標籤組件
 */

import { Badge } from "@/Components/ui/badge";
import { PurchaseOrderStatus } from "@/types/purchase-order";
import { STATUS_CONFIG } from "@/constants/purchase-order";

interface PurchaseOrderStatusBadgeProps {
    status: PurchaseOrderStatus;
    className?: string;
}

export default function PurchaseOrderStatusBadge({
    status,
    className,
}: PurchaseOrderStatusBadgeProps) {
    const config = STATUS_CONFIG[status] || { label: "未知", variant: "outline" };

    return (
        <Badge
            variant={config.variant}
            className={`${className} font-medium px-2.5 py-0.5 rounded-full`}
        >
            {config.label}
        </Badge>
    );
}
