File indexing completed on 2025-01-26 05:27:59
0001 import React, { Component } from 'react'; 0002 0003 class Product extends React.Component { 0004 render(){ 0005 let projectUrl = this.props.baseUrlStore+"/p/"+this.props.product.project_id; 0006 const scoreDisplay=( 0007 <div className="score-info"> 0008 <div className="score-number"> 0009 {(this.props.product.laplace_score/10).toFixed(1) + "%"} 0010 </div> 0011 <div className="score-bar-container"> 0012 <div className={"score-bar"} style={{"width":this.props.product.laplace_score/10 + "%"}}></div> 0013 </div> 0014 </div> 0015 ); 0016 0017 const productInfoDisplay = ( 0018 <div className="product-info"> 0019 <span className="product-info-title"><a href={projectUrl} >{this.props.product.title}</a></span> 0020 <span className="product-info-category">{this.props.product.cat_title}</span> 0021 <span className="product-info-date">{this.props.product.updated_at}</span> 0022 </div> 0023 ); 0024 0025 0026 return ( 0027 <div className="productrow row"> 0028 <div className="col-lg-2"> 0029 <a href={projectUrl} > 0030 <figure > 0031 <img className="productimg" src={this.props.product.image_small} /> 0032 </figure> 0033 </a> 0034 </div> 0035 <div className="col-lg-7"> 0036 {productInfoDisplay} 0037 </div> 0038 <div className="col-lg-3"> 0039 {scoreDisplay} 0040 </div> 0041 </div> 0042 ) 0043 } 0044 } 0045 0046 export default Product;