dify/web/app/components/base/badge.tsx

29 lines
550 B
TypeScript
Raw Normal View History

2024-07-24 12:50:48 +08:00
import { memo } from 'react'
import cn from '@/utils/classnames'
type BadgeProps = {
className?: string
text: string
uppercase?: boolean
2024-07-24 12:50:48 +08:00
}
const Badge = ({
className,
text,
uppercase = true,
2024-07-24 12:50:48 +08:00
}: BadgeProps) => {
return (
<div
className={cn(
'inline-flex items-center px-[5px] h-5 rounded-[5px] border border-divider-deep leading-3 text-text-tertiary',
uppercase ? 'system-2xs-medium-uppercase' : 'system-xs-medium',
2024-07-24 12:50:48 +08:00
className,
)}
>
{text}
</div>
)
}
export default memo(Badge)