366
Hc
hirenimble-challenge / files
hirenimble-challenge / src / components / candidateListContent.js
1.0 KB
1import React from "react"; 2import moment from "moment"; 3 4function CandidateListContent(props) { 5 const candidates = props.candidates; 6 return candidates.map((candidate) => { 7 return ( 8 <React.Fragment> 9 <tr key={candidate.id} id={candidate.id}> 10 <td>{candidate.name}</td> 11 <td> 12 {candidate.applications[0].new_status.color} 13 {candidate.applications[0].new_status.label} 14 </td> 15 <td>{candidate.applications.lengtd}</td> 16 <td>{moment(candidate.profile.updated).fromNow()}</td> 17 <td>{candidate.scorecard_count}</td> 18 <td>{candidate.profile.nimble_score}</td> 19 <td>{candidate.note_count}</td> 20 </tr> 21 {candidate.applications.map((application) => { 22 return ( 23 <tr key={application.id}> 24 <td>{application.role.title}</td> 25 <td>{application.new_status.label}</td> 26 </tr> 27 ); 28 })} 29 </React.Fragment> 30 ); 31 }); 32} 33 34export default CandidateListContent;