<commit_before>import * as React from 'react';
import { connect } from 'react-redux';
import { RootState, DailyEarnings } from '../../../types';
import { Card, Stack, Heading } from '@shopify/polaris';
import { formatAsCurrency } from '../../../utils/formatting';
import {
  earningsOnDate,
  pendingEarningsOnDate,
  hitsOnSelectedDateIds
} from '../../../selectors/hitDatabaseDay';
import PaginationButtons, {
  Handlers as PaginationHandlers,
  Props as PaginationProps
} from './PaginationButtons';

export interface Props {
  readonly numSubmitted: number;
  readonly earningsPending: number;
  readonly dailyEarnings: DailyEarnings;
}

class InfoHeader extends React.PureComponent<
  Props & PaginationHandlers & PaginationProps,
  never
> {
  static showPendingEarnings = (earningsPending: number) =>
    earningsPending > 0 ? `${formatAsCurrency(earningsPending)} pending. ` : '';

  static earningsDisplay = (reward: number, bonus: number) =>
    bonus > 0
      ? `${formatAsCurrency(reward)} + ${formatAsCurrency(
          bonus
        )} (in bonuses) earned.`
      : `${formatAsCurrency(reward)} earned.`;

  public render() {
    const {
      dailyEarnings: { reward, bonus },
      numSubmitted,
      earningsPending
    } = this.props;

    return numSubmitted > 0 ? (
      <Card.Section>
        <Stack vertical={false} spacing="tight" alignment="baseline">
          <PaginationButtons {...this.props} />
          <Heading>
            {InfoHeader.earningsDisplay(reward, bonus)}
            {InfoHeader.showPendingEarnings(earningsPending)} {numSubmitted}{' '}
            HITs submitted.
          </Heading>
        </Stack>
      </Card.Section>
    ) : null;
  }
}

const mapState = (state: RootState): Props => ({
  dailyEarnings: earningsOnDate(state),
  earningsPending: pendingEarningsOnDate(state),
  numSubmitted: hitsOnSelectedDateIds(state).size
});

export default connect(mapState)(InfoHeader);<commit_msg>Add space between earnings and pending earnings.<commit_after>import * as React from 'react';
import { connect } from 'react-redux';
import { RootState, DailyEarnings } from '../../../types';
import { Card, Stack, Heading } from '@shopify/polaris';
import { formatAsCurrency } from '../../../utils/formatting';
import {
  earningsOnDate,
  pendingEarningsOnDate,
  hitsOnSelectedDateIds
} from '../../../selectors/hitDatabaseDay';
import PaginationButtons, {
  Handlers as PaginationHandlers,
  Props as PaginationProps
} from './PaginationButtons';

export interface Props {
  readonly numSubmitted: number;
  readonly earningsPending: number;
  readonly dailyEarnings: DailyEarnings;
}

class InfoHeader extends React.PureComponent<
  Props & PaginationHandlers & PaginationProps,
  never
> {
  static showPendingEarnings = (earningsPending: number) =>
    earningsPending > 0 ? `${formatAsCurrency(earningsPending)} pending. ` : '';

  static showEarnings = (reward: number, bonus: number) =>
    bonus > 0
      ? `${formatAsCurrency(reward)} + ${formatAsCurrency(
          bonus
        )} (in bonuses) earned.`
      : `${formatAsCurrency(reward)} earned.`;

  public render() {
    const {
      dailyEarnings: { reward, bonus },
      numSubmitted,
      earningsPending
    } = this.props;

    return numSubmitted > 0 ? (
      <Card.Section>
        <Stack vertical={false} spacing="tight" alignment="baseline">
          <PaginationButtons {...this.props} />
          <Heading>
            {InfoHeader.showEarnings(reward, bonus)}{' '}
            {InfoHeader.showPendingEarnings(earningsPending)} {numSubmitted}{' '}
            HITs submitted.
          </Heading>
        </Stack>
      </Card.Section>
    ) : null;
  }
}

const mapState = (state: RootState): Props => ({
  dailyEarnings: earningsOnDate(state),
  earningsPending: pendingEarningsOnDate(state),
  numSubmitted: hitsOnSelectedDateIds(state).size
});

export default connect(mapState)(InfoHeader);
{'fraction_non_alphanumeric': 0.1302242609582059, 'fraction_numerical': 0.0015290519877675841, 'mean_word_length': 3.4350282485875705, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 31, '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': '2271265', 'n_tokens_mistral': 1169, 'n_tokens_neox': 1166, 'n_words': 261}