<commit_before>// @flow
import * as modals from 'constants/modal_types';
import * as statuses from 'constants/thumbnail_upload_statuses';
import React from 'react';
import { FormField } from 'component/common/form';
import FileSelector from 'component/common/file-selector';

type Props = {
  thumbnail: ?string,
  formDisabled: boolean,
  uploadThumbnailStatus: string,
  openModal: (string, any) => void,
  updatePublishForm: ({}) => void,
};

class SelectThumbnail extends React.PureComponent<Props> {
  render() {
    const {
      thumbnail,
      formDisabled,
      uploadThumbnailStatus: status,
      openModal,
      updatePublishForm,
    } = this.props;

    return (
      <div>
        {(status === statuses.READY || status === statuses.IN_PROGRESS) && (
          <div>
            <span className="form-field__label">{__('Thumbnail')}</span>
            <FileSelector
              fileLabel={__('Choose Thumbnail')}
              onFileChosen={path => openModal(modals.CONFIRM_THUMBNAIL_UPLOAD, { path })}
            />
          </div>
        )}

        {(status === statuses.API_DOWN || status === statuses.MANUAL) && (
          <FormField
            stretch
            type="text"
            name="content_thumbnail"
            label={__('Thumbnail')}
            placeholder="http://spee.ch/mylogo"
            value={thumbnail}
            disabled={formDisabled}
            onChange={e => updatePublishForm({ thumbnail: e.target.value })}
          />
        )}

        {status === statuses.READY && (
          <div>
            <a
              className="link"
              onClick={() => updatePublishForm({ uploadThumbnailStatus: statuses.MANUAL })}
            >
              Enter URL Manually
            </a>
          </div>
        )}

        {status === statuses.MANUAL && (
          <div>
            <a
              className="link"
              onClick={() => updatePublishForm({ uploadThumbnailStatus: statuses.READY })}
            >
              Upload Thumbnail
            </a>
          </div>
        )}

        {status === statuses.IN_PROGRESS && <div>uploading...</div>}

        {status === statuses.COMPLETE && (
          <div>
            <p className="form-field__label">{__('Thumbnail')}</p>
            <p>
              Upload Complete<br />URL: {thumbnail}
            </p>
          </div>
        )}
      </div>
    );
  }
}

export default SelectThumbnail;<commit_msg>change div tags to p tags for padding<commit_after>// @flow
import * as modals from 'constants/modal_types';
import * as statuses from 'constants/thumbnail_upload_statuses';
import React from 'react';
import { FormField } from 'component/common/form';
import FileSelector from 'component/common/file-selector';

type Props = {
  thumbnail: ?string,
  formDisabled: boolean,
  uploadThumbnailStatus: string,
  openModal: (string, any) => void,
  updatePublishForm: ({}) => void,
};

class SelectThumbnail extends React.PureComponent<Props> {
  render() {
    const {
      thumbnail,
      formDisabled,
      uploadThumbnailStatus: status,
      openModal,
      updatePublishForm,
    } = this.props;

    return (
      <div>
        {(status === statuses.READY || status === statuses.IN_PROGRESS) && (
          <div>
            <span className="form-field__label">{__('Thumbnail')}</span>
            <FileSelector
              fileLabel={__('Choose Thumbnail')}
              onFileChosen={path => openModal(modals.CONFIRM_THUMBNAIL_UPLOAD, { path })}
            />
          </div>
        )}

        {(status === statuses.API_DOWN || status === statuses.MANUAL) && (
          <FormField
            stretch
            type="text"
            name="content_thumbnail"
            label={__('Thumbnail')}
            placeholder="http://spee.ch/mylogo"
            value={thumbnail}
            disabled={formDisabled}
            onChange={e => updatePublishForm({ thumbnail: e.target.value })}
          />
        )}

        {status === statuses.READY && (
          <p>
            <a
              className="link"
              onClick={() => updatePublishForm({ uploadThumbnailStatus: statuses.MANUAL })}
            >
              Enter URL Manually
            </a>
          </p>
        )}

        {status === statuses.MANUAL && (
          <p>
            <a
              className="link"
              onClick={() => updatePublishForm({ uploadThumbnailStatus: statuses.READY })}
            >
              Upload Thumbnail
            </a>
          </p>
        )}

        {status === statuses.IN_PROGRESS && <div>uploading...</div>}

        {status === statuses.COMPLETE && (
          <div>
            <p className="form-field__label">{__('Thumbnail')}</p>
            <p>
              Upload Complete<br />URL: {thumbnail}
            </p>
          </div>
        )}
      </div>
    );
  }
}

export default SelectThumbnail;
{'fraction_non_alphanumeric': 0.1364562118126273, 'fraction_numerical': 0.0, 'mean_word_length': 1.815940366972477, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 67, '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': '7479666', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1424, 'n_words': 264}