import { StatusBadge, StatusVariant } from "@/Components/shared/StatusBadge";

export type GoodsReceiptStatus = 'processing' | 'completed' | 'cancelled';

export const GOODS_RECEIPT_STATUS_CONFIG: Record<string, { label: string; variant: StatusVariant }> = {
    processing: { label: "處理中", variant: "info" },
    completed: { label: "已完成", variant: "success" },
    cancelled: { label: "已取消", variant: "destructive" },
};

interface GoodsReceiptStatusBadgeProps {
    status: string;
    className?: string;
}

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

    return (
        <StatusBadge variant={config.variant} className={className}>
            {config.label}
        </StatusBadge>
    );
}
