26 lines
725 B
TypeScript
26 lines
725 B
TypeScript
import { cn, priorityColor, riskColor, statusColor, reviewResultColor } from '@/lib/utils'
|
|
|
|
interface BadgeProps {
|
|
text: string
|
|
type?: 'priority' | 'risk' | 'status' | 'review' | 'default'
|
|
className?: string
|
|
}
|
|
|
|
export function Badge({ text, type = 'default', className }: BadgeProps) {
|
|
const colorClass = type === 'priority'
|
|
? priorityColor(text)
|
|
: type === 'risk'
|
|
? riskColor(text)
|
|
: type === 'status'
|
|
? statusColor(text)
|
|
: type === 'review'
|
|
? reviewResultColor(text)
|
|
: 'bg-gray-100 text-gray-700 border border-gray-300'
|
|
|
|
return (
|
|
<span className={cn('inline-flex items-center rounded-md px-2 py-0.5 text-xs font-medium', colorClass, className)}>
|
|
{text}
|
|
</span>
|
|
)
|
|
}
|