<commit_before>import React from 'react';
import Modal from 'modal/modal';
import Button from 'component/button';

const RewardLink = props => {
  const { reward, button, claimReward, clearError, errorMessage, label, isPending } = props;

  return !reward ? null : (
    <div className="reward-link">
      <Button
        button="primary"
        disabled={isPending}
        label={isPending ? __('Claiming...') : label || `${__('Get')} ${reward.reward_amount} LBC`}
        onClick={() => {
          claimReward(reward);
        }}
      />
      {errorMessage ? (
        <Modal
          isOpen
          contentLabel="Reward Claim Error"
          className="error-modal"
          onConfirmed={() => {
            clearError(reward);
          }}
        >
          {errorMessage}
        </Modal>
      ) : (
        ''
      )}
    </div>
  );
};
export default RewardLink;<commit_msg>update invite claim reward link style<commit_after>// @flow
import React from 'react';
import { Modal } from 'modal/modal';
import Button from 'component/button';

type Reward = {
  reward_amount: number,
};

type Props = {
  isPending: boolean,
  label: ?string,
  errorMessage: ?string,
  reward: Reward,
  clearError: Reward => void,
  claimReward: Reward => void,
};

const RewardLink = (props: Props) => {
  const { reward, claimReward, clearError, errorMessage, label, isPending } = props;

  return !reward ? null : (
    <div className="reward-link">
      <Button
        button="link"
        disabled={isPending}
        label={isPending ? __('Claiming...') : label || `${__('Get')} ${reward.reward_amount} LBC`}
        onClick={() => {
          claimReward(reward);
        }}
      />
      {errorMessage ? (
        // TODO: This should be moved to redux
        <Modal
          isOpen
          contentLabel="Reward Claim Error"
          className="error-modal"
          onConfirmed={() => {
            clearError(reward);
          }}
        >
          {errorMessage}
        </Modal>
      ) : (
        ''
      )}
    </div>
  );
};

export default RewardLink;
{'fraction_non_alphanumeric': 0.14306289006241, 'fraction_numerical': 0.0, 'mean_word_length': 2.143288084464555, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2390355', 'n_tokens_mistral': 624, 'n_tokens_neox': 633, 'n_words': 143}