File indexing completed on 2025-01-26 05:27:59

0001 import React from 'react';
0002 import {filterDuplicated} from './util';
0003 const Header = (props) => {
0004   const s = props.supporters.filter(filterDuplicated).length;  
0005   let goal = Math.ceil((s/50))*50;
0006   if(goal==0){goal = 50;}
0007   return (
0008       <div className="pling-section-header">
0009           <div className="header-title">
0010             <span>{props.section ? props.section.name:''}</span>
0011           </div>
0012           <div className="score-container">
0013             <span>Goal:</span>
0014             <div className="score-bar-container">
0015               <div className={"score-bar"} style={{"width":(s/goal)*100 + "%"}}>
0016                 {s}
0017               </div>
0018             </div>
0019             <span>{goal}</span>
0020           </div>
0021       </div>
0022   )
0023 }
0024 export default Header
0025