初始化:连锁餐饮数字化运营管理平台
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user