{"size": 1263, "ext": "js", "max_stars_repo_path": "src/app/search-result/result-card/result-card-details/ResultCardDetails.js", "max_stars_repo_name": "andreyleonardo/search-app-study", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/app/search-result/result-card/result-card-details/ResultCardDetails.js", "max_issues_repo_name": "andreyleonardo/search-app-study", "max_issues_repo_issues_event_min_datetime": "2019-12-29T09:20:13.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T14:16:28.000Z", "max_forks_repo_path": "src/app/search-result/result-card/result-card-details/ResultCardDetails.js", "max_forks_repo_name": "andreyleonardo/search-app-study", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 8, "max_forks_count": null, "avg_line_length": 29.3720930233, "max_line_length": 90, "alphanum_fraction": 0.703087886}
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage } from 'react-intl';
import Ratings from './ratings/Ratings';

import './ResultCardDetails.scss';

const ResultCardDetails = ({
  rating, isSpecialOffer, currency, price
}) => (
  <section className="result_card_details row between-xs middle-xs">
    <div className="result_card_details__rating col-xs-4 col-sm">
      <Ratings rating={rating}>
        <FormattedMessage id="result_card_details.rating" values={{ rating }} />
      </Ratings>
    </div>
    <div className="result_card_details__pricing col-xs col-sm">
      {isSpecialOffer && (
        <span className="result_card_details__special_offer">
          <FormattedMessage id="result_card_details.special_offer" />
        </span>
      )}
      <span className="result_card_details__price">
        <FormattedMessage id="result_card_details.pricing" values={{ currency, price }} />
      </span>
    </div>
  </section>
);

ResultCardDetails.propTypes = {
  rating: PropTypes.number,
  currency: PropTypes.string.isRequired,
  price: PropTypes.string.isRequired,
  isSpecialOffer: PropTypes.bool
};

ResultCardDetails.defaultProps = {
  rating: 0,
  isSpecialOffer: false
};

export default ResultCardDetails;
