import { type TicketPriority } from "@/lib/schemas/ticket"
import { Badge } from "@/components/ui/badge"
import { cn } from "@/lib/utils"
import { PriorityIcon } from "@/components/tickets/priority-select"
import { getTicketPriorityMeta } from "@/lib/ticket-priority-style"

const baseClass = "inline-flex h-7 items-center gap-2 rounded-full px-3 text-xs font-semibold"

export function TicketPriorityPill({ priority, className }: { priority: TicketPriority; className?: string }) {
  const styles = getTicketPriorityMeta(priority)
  return (
    <Badge className={cn(baseClass, styles.badgeClass, className)}>
      <PriorityIcon value={priority} />
      {styles.label}
    </Badge>
  )
}
