import * as React from "react"; import { AlertCircle, Ban, SignalHigh, SignalLow, SignalMedium } from "lucide-react"; import { cn } from "../../helpers"; type TIssuePriorities = "urgent" | "high" | "medium" | "low" | "none"; interface IPriorityIcon { className?: string; containerClassName?: string; priority: TIssuePriorities; size?: number; withContainer?: boolean; } export const PriorityIcon: React.FC = (props) => { const { priority, className = "", containerClassName = "", size = 14, withContainer = false } = props; const priorityClasses = { urgent: "bg-red-500 text-red-500 border-red-500", high: "bg-orange-500/20 text-orange-500 border-orange-500", medium: "bg-yellow-500/20 text-yellow-500 border-yellow-500", low: "bg-custom-primary-100/20 text-custom-primary-100 border-custom-primary-100", none: "bg-custom-background-80 text-custom-text-200 border-custom-border-300", }; // get priority icon const icons = { urgent: AlertCircle, high: SignalHigh, medium: SignalMedium, low: SignalLow, none: Ban, }; const Icon = icons[priority]; if (!Icon) return null; return ( <> {withContainer ? (
) : ( )} ); };