diff --git a/assets/js/src/common/button/button.tsx b/assets/js/src/common/button/button.tsx index 4dbe456374..fc3117219d 100644 --- a/assets/js/src/common/button/button.tsx +++ b/assets/js/src/common/button/button.tsx @@ -12,6 +12,7 @@ type Props = { iconEnd?: JSX.Element, onClick?: () => void, href?: string, + type?: string, target?: '_blank' | '_self' | '_parent' | '_top' | string, }; @@ -27,28 +28,31 @@ const Button = ({ onClick, href, target, -}: Props) => ( - - {iconStart} - {children && {children}} - {iconEnd} - -); +}: Props) => { + const Element = href ? 'a' : 'button'; + return ( + + {iconStart} + {children && {children}} + {iconEnd} + + ); +}; export default Button;