import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import cx from 'classnames'; import './style.scss'; type ButtonProps = { classnames?: string; icon?: any; children: React.ReactNode; onClick?: () => void; href?: string; type?: 'button' | 'submit' | 'reset'; variant?: boolean; disabled?: boolean; }; const Button = ({icon, children, onClick, href, type, variant, disabled, classnames, ...rest}: ButtonProps) => { const handleHrefClick = (e) => { e.preventDefault(); window.parent.location = href; }; if (href) { return ( handleHrefClick(e)} href={href} {...rest} > {children} {icon && } ); } return ( ); }; export default Button;