import type { TicketStatus } from "@/lib/types"
import { cn } from "@/lib/utils"

interface StatusBadgeProps {
  status: TicketStatus
  className?: string
}

const statusConfig: Record<TicketStatus, { label: string; className: string }> = {
  OPEN: {
    label: "Offen",
    className: "bg-status-open text-status-open-foreground",
  },
  "IN_PROGRESS": {
    label: "In Bearbeitung",
    className: "bg-status-progress text-status-progress-foreground",
  },
  CLOSED: {
    label: "Erledigt",
    className: "bg-status-done text-status-done-foreground",
  },
}

export function StatusBadge({ status, className }: StatusBadgeProps) {
  const config = statusConfig[status]

  return (
    <span
      className={cn(
        "inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium",
        config.className,
        className
      )}
    >
      {config.label}
    </span>
  )
}
