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

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

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