import { Badge } from "@/Components/ui/badge";
import { PurchaseReturnStatus, PURCHASE_RETURN_STATUS_CONFIG } from "@/types/purchase-return";

interface PurchaseReturnStatusBadgeProps {
    status: PurchaseReturnStatus | string;
    className?: string;
}

export default function PurchaseReturnStatusBadge({
    status,
    className = "",
}: PurchaseReturnStatusBadgeProps) {
    const config = PURCHASE_RETURN_STATUS_CONFIG[status as PurchaseReturnStatus] || {
        label: status,
        color: "bg-gray-100 text-gray-800",
    };

    return (
        <Badge
            variant="secondary"
            className={`${config.color} whitespace-nowrap min-w-[72px] justify-center ${className}`}
        >
            {config.label}
        </Badge>
    );
}
