import type React from 'react';
import { Link } from 'react-router-dom';

import styles from './Button.module.scss';
import type { BtnInterface } from './ButtonHelper';

const Button: React.FC<BtnInterface> = ({
	id,
	type,
	value,
	link,
	buttonClass,
	whiteBtn,
	svg,
	onClick
}: BtnInterface): JSX.Element => (
	<button
		className={[buttonClass, styles.button, whiteBtn ? styles.white : ''].join(' ')}
		id={id}
		onClick={onClick}
		// eslint-disable-next-line react/button-has-type
		type={type}
	>
		<Link onClick={onClick} to={link}>
			{svg} {value}
		</Link>
	</button>
);
export default Button;
