feat: add label and fix some ui problem

This commit is contained in:
Joel
2024-10-10 11:29:11 +08:00
parent 6d62840aff
commit 19f5684960
7 changed files with 42 additions and 15 deletions

View File

@ -5,22 +5,28 @@ type BadgeProps = {
className?: string
text: string
uppercase?: boolean
hasRedCornerMark?: boolean
}
const Badge = ({
className,
text,
uppercase = true,
hasRedCornerMark,
}: BadgeProps) => {
return (
<div
className={cn(
'inline-flex items-center px-[5px] h-5 rounded-[5px] border border-divider-deep leading-3 text-text-tertiary',
'relative 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',
className,
)}
>
{text}
{hasRedCornerMark && (
<div className='absolute top-[-2px] right-[-2px] w-1.5 h-1.5 border border-components-badge-status-light-error-border-inner bg-components-badge-status-light-error-bg rounded-[2px] shadow-sm'>
</div>
)}
</div>
)
}