<commit_before>import React, { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import Availability from '@shopgate/pwa-ui-shared/Availability';
import Portal from '@shopgate/pwa-common/components/Portal';
import {
  PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_BEFORE,
  PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY,
  PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_AFTER,
} from '@shopgate/pwa-common-commerce/product/constants/Portals';
import connect from './connector';
import styles from './style';

/**
 * The VariantAvailability component.
 */
class VariantAvailability extends PureComponent {
  static propTypes = {
    availability: PropTypes.shape(),
  };

  static defaultProps = {
    availability: null,
  };

  /**
   * @returns {JSX}
   */
  render() {
    const { availability } = this.props;
    const { state, text } = availability || {};
    if (!availability) {
      return null;
    }

    return (
      <Fragment>
        <Portal
          name={PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_BEFORE}
          props={{
            text,
            state,
          }}
        />
        <Portal
          name={PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY}
          props={{
            text,
            state,
          }}
        >
          <Availability className={styles} state={state} text={text} />
        </Portal>
        <Portal
          name={PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_AFTER}
          props={{
            text,
            state,
          }}
        />
      </Fragment>
    );
  }
}

export default connect(VariantAvailability);<commit_msg>CCP-1184 Adjusted small codestyle issues.<commit_after>import React, { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import Availability from '@shopgate/pwa-ui-shared/Availability';
import Portal from '@shopgate/pwa-common/components/Portal';
import {
  PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_BEFORE,
  PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY,
  PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_AFTER,
} from '@shopgate/pwa-common-commerce/product/constants/Portals';
import connect from './connector';
import styles from './style';

/**
 * The VariantAvailability component.
 */
class VariantAvailability extends PureComponent {
  static propTypes = {
    availability: PropTypes.shape(),
  };

  static defaultProps = {
    availability: null,
  };

  /**
   * @returns {JSX}
   */
  render() {
    if (!this.props.availability) {
      return null;
    }

    const { availability } = this.props;
    const { state, text } = availability;

    return (
      <Fragment>
        <Portal name={PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_BEFORE} props={availability} />
        <Portal name={PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY} props={availability}>
          <Availability className={styles} state={state} text={text} />
        </Portal>
        <Portal name={PRODUCT_VARIANT_SELECT_PICKER_AVAILABILITY_AFTER} props={availability} />
      </Fragment>
    );
  }
}

export default connect(VariantAvailability);
{'fraction_non_alphanumeric': 0.11085751548744702, 'fraction_numerical': 0.0013042060645582002, 'mean_word_length': 3.1126005361930296, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '7326075', 'n_tokens_mistral': 945, 'n_tokens_neox': 922, 'n_words': 171}