Skip to content

Commit

Permalink
fix: add missing label prop usage in the Button component
Browse files Browse the repository at this point in the history
  • Loading branch information
bacali95 committed Apr 13, 2022
1 parent 1790b4f commit 5e8c291
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const iconSizeClasses: Record<Size, string> = {
export const Button: FC<ButtonProps> = ({
children,
className,
label,
pill,
outline,
disabled = false,
Expand Down Expand Up @@ -134,7 +135,18 @@ export const Button: FC<ButtonProps> = ({
[iconSizeClasses[size]]: !!Icon,
})}
>
{Icon ? <Icon className="h-5 w-5" /> : children}
{Icon ? (
<Icon className="h-5 w-5" />
) : (
<>
{children}
{label && (
<span className="ml-2 inline-flex h-4 w-4 items-center justify-center rounded-full bg-blue-200 text-xs font-semibold text-blue-800">
{label}
</span>
)}
</>
)}
</span>
</button>
);
Expand Down

0 comments on commit 5e8c291

Please sign in to comment.