import { h, Component } from 'preact';

import * as styles from './css/index.less';

interface ActGoodsDetailPrimaryButtonProps {
  primaryButton?: string;
  primaryLongButton?: boolean; // 是否为长按钮
  clickButton?: () => void;
  isCommercial?: boolean; // 是否是商业化
}

export default class ActGoodsDetailPrimaryButton extends Component<ActGoodsDetailPrimaryButtonProps, {}> {
  render() {
    const { primaryButton, primaryLongButton, clickButton = (() => {}), isCommercial = false } = this.props;
    return (
      <div
        className={`${styles['battle-info-btn']} ${isCommercial ? styles.commercial : ''} ${primaryLongButton ? styles['battle-info-btn--long'] : ''}`}
        onClick={clickButton}
      >
        <text className={styles['battle-info-btn-text']}>{primaryButton}</text>
      </div>
    );
  }
}
