import React, { Component } from 'react'; import './SearchResults.css'; import striptags from 'striptags'; class SearchResult extends Component { badge(f) { if (this.props.data.udf[f]) { return ( {this.props.data.udf[f].label}{' '} ); } else { return null; } } image() { const src = this.props.data['image-url']; if (src) { return (); } else { return null; } } render() { return (

{this.props.data.name}

{this.image()}
{this.badge('udf_3')} {this.badge('udf_2')} {this.badge('udf_1')} {this.props.data.childcare ? (Childcare) : null}

{striptags(this.props.data.description)}

Day: {this.props.data.meetingDay.label}{" "} Time: {this.props.data.meetingTime.label}{" "} Location: {this.props.data['location-city']}

Group Leader: {this.props.data['leader-name']}{" "}

Sign Up for Group

); } } class SearchResults extends Component { render() { let results = this.props.results.map((result) => { return ( ); }); return (

Found {results.length} groups

{results}
); } } export default SearchResults;