diff --git a/packages/react/src/Button/Button.tsx b/packages/react/src/Button/Button.tsx index e9f9461062..cbba51c985 100644 --- a/packages/react/src/Button/Button.tsx +++ b/packages/react/src/Button/Button.tsx @@ -5,7 +5,7 @@ import clsx from 'clsx' import { forwardRef } from 'react' -import type { ButtonHTMLAttributes, ForwardedRef, PropsWithChildren, ReactNode } from 'react' +import type { ButtonHTMLAttributes, ForwardedRef, PropsWithChildren } from 'react' import { Icon } from '../Icon' import type { IconProps } from '../Icon' @@ -42,42 +42,19 @@ export const Button = forwardRef( ( { children, className, disabled, icon, iconBefore, iconOnly, type, variant = 'primary', ...restProps }: ButtonProps, ref: ForwardedRef, - ) => { - const content = (): ReactNode => { - switch (true) { - case !icon: - return children - case iconBefore: - return [, children] - case iconOnly: - return [ - , - - {children} - , - ] - default: - return [children, ] - } - } - - return ( - - ) - }, + ) => ( + + ), ) Button.displayName = 'Button'