diff --git a/frontend/src/component/common/Badge/Badge.tsx b/frontend/src/component/common/Badge/Badge.tsx index 9f0a674c22..2eb3dc1b19 100644 --- a/frontend/src/component/common/Badge/Badge.tsx +++ b/frontend/src/component/common/Badge/Badge.tsx @@ -40,6 +40,7 @@ const StyledBadge = styled('span')( ({ theme, color = 'neutral', icon }) => ({ display: 'inline-flex', alignItems: 'center', + gap: theme.spacing(0.5), padding: theme.spacing(icon ? 0.375 : 0.625, 1), borderRadius: theme.shape.borderRadius, fontSize: theme.fontSizes.smallerBody, @@ -61,28 +62,16 @@ const StyledBadge = styled('span')( const StyledBadgeIcon = styled('span')< IBadgeIconProps & { hasChildren?: boolean } ->(({ theme, color = 'neutral', iconRight = false, hasChildren }) => ({ +>(({ theme, color = 'neutral' }) => ({ display: 'flex', color: color === 'disabled' ? theme.palette.action.disabled : theme.palette[color].main, - margin: iconRight - ? theme.spacing(0, 0, 0, hasChildren ? 0.5 : 0) - : theme.spacing(0, hasChildren ? 0.5 : 0, 0, 0), })); -const BadgeIcon = ( - color: Color, - icon: ReactElement, - iconRight = false, - hasChildren = false, -) => ( - +const BadgeIcon = (color: Color, icon: ReactElement) => ( + = forwardRef( > + {children}} /> - {children} ),