<commit_before>import React from 'react';
import Details from './Details';

const currency = n => n.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');

export const Item = props => {

  const {
    _id,
    labels,
    code,
    price,
    name
  } = props;

  const showBackorder = !!(+ labels.backorder);
  const showNewArrival = !!(+ labels.arrival) && !showBackorder;
  const showNew = !!(+ labels.new) && !showBackorder;
  const showNewPrice = !!(+ labels.price) && !showBackorder;

  const NewArrivalImage = require(`../../img/newarrival/new-arrival-${Math.ceil(Math.random() * 4)}.gif`);
  const NewImage = require(`../../img/new/new${Math.ceil(Math.random() * 9)}.gif`);
  const NewPriceImage = require(`../../img/newprice/new-price-${Math.ceil(Math.random() * 4)}.gif`);
  const BackorderImage = require('../../img/backorder/bo2.png');

  return (
    <div className="item">
      <div className="pre-item">
        {showBackorder && (<img className={'backorder'} src={BackorderImage} alt={'Backorder'}/>)}
        {showNewArrival && (<img src={NewArrivalImage} className={'itemLabelImg'} alt="New arrival!" id={_id}/>)}
        {showNew && (<img src={NewImage} className={'itemLabelImg'} alt="New product!" id={_id}/>)}
        {showNewPrice && (<img src={NewPriceImage} className={'itemLabelImg'} alt="New price!" id={_id}/>)}
        <br/>
        <b>{name}</b><br/>
        <div className="side_item" style={{
          float: 'right'
        }}>
        </div>
        <span>
          <small>
            {/* {<img className="png_alpha" alt={code} src={`//rockplusinc.com/img/full/thumbs/_${code}.png`}/>} */}
            <Details imgClassName={"png_alpha"} src={`//rockplusinc.com/img/full/_${code}.png`} thumbsSrc={`//rockplusinc.com/img/full/thumbs/_${code}.png`} title={name}/>
          </small>
        </span><br/>
        2 Per Packs<br/>
        <span className={+ labels.clearance
          ? 'clearance'
          : ''}>
          {price
            ? currency(price)
            : 'no price'}$
        </span><br/>
      </div>
    </div>
  )
};

export default Item;
<commit_msg>fixed $ when no price<commit_after>import React from 'react';
import Details from './Details';
import NoImageAvail from '../../img/nopic.png';

const currency = n => n.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');

export const Item = props => {

  const {_id, labels, price, name, imgThumb, imgFull} = props;

  const showBackorder = !!(+ labels.backorder);
  const showNewArrival = !!(+ labels.arrival) && !showBackorder;
  const showNew = !!(+ labels.new) && !showBackorder;
  const showNewPrice = !!(+ labels.price) && !showBackorder;

  const NewArrivalImage = require(`../../img/newarrival/new-arrival-${Math.ceil(Math.random() * 4)}.gif`);
  const NewImage = require(`../../img/new/new${Math.ceil(Math.random() * 9)}.gif`);
  const NewPriceImage = require(`../../img/newprice/new-price-${Math.ceil(Math.random() * 4)}.gif`);
  const BackorderImage = require('../../img/backorder/bo2.png');

  return (
    <div className="item">
      <div className="pre-item">
        {showBackorder && (<img className={'backorder'} src={BackorderImage} alt={'Backorder'}/>)}
        {showNewArrival && (<img src={NewArrivalImage} className={'itemLabelImg'} alt="New arrival!" id={_id}/>)}
        {showNew && (<img src={NewImage} className={'itemLabelImg'} alt="New product!" id={_id}/>)}
        {showNewPrice && (<img src={NewPriceImage} className={'itemLabelImg'} alt="New price!" id={_id}/>)}
        <br/>
        <b>{name}</b><br/>
        <div className="side_item" style={{
          float: 'right'
        }}></div>
        <span>
          <small>
            <Details imgClassName={"png_alpha"} src={imgFull || NoImageAvail} thumbsSrc={imgThumb || NoImageAvail} title={name}/>
          </small>
        </span><br/>
        2 Per Packs<br/>
        <span className={+ labels.clearance
          ? 'clearance'
          : ''}>
          {!!price && currency(price) + '$'}
        </span><br/>
      </div>
    </div>
  )
};

export default Item;

{'fraction_non_alphanumeric': 0.21428571428571427, 'fraction_numerical': 0.003940886699507389, 'mean_word_length': 2.9048076923076924, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 56, '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': '1853857', 'n_tokens_mistral': 1356, 'n_tokens_neox': 1335, 'n_words': 250}