/* eslint-disable react/button-has-type */
/* eslint-disable arrow-body-style */
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import PropTypes from 'prop-types';

import styles from './newsletter-button.module.scss';

const NewsletterButton = ({
  text = 'Bonus alert',
  toggleNewsLetter,
  active = true,
  ppcPage = false,
}) => {
  return (
    <button
      onClick={toggleNewsLetter}
      className={`${styles?.button || ''} ${active ? styles.active || '' : ''} ${
        ppcPage ? styles.ppcButton || '' : ''
      }`}
    >
      {text}
    </button>
  );
};

NewsletterButton.propTypes = {
  text: PropTypes.string,
  toggleNewsLetter: PropTypes.bool,
  active: PropTypes.bool,
  ppcPage: PropTypes.bool,
};

export default NewsletterButton;
