2018-05-09 10:25:08 +02:00
|
|
|
import React from 'react'
|
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
|
|
|
|
export default function ActivityCard (props) {
|
|
|
|
const { activity, sports } = props
|
|
|
|
|
|
|
|
return (
|
2018-05-10 17:21:19 +02:00
|
|
|
<div className="card activity-card text-center">
|
2018-05-09 10:25:08 +02:00
|
|
|
<div className="card-header">
|
|
|
|
<Link to={`/activities/${activity.id}`}>
|
|
|
|
{sports.filter(sport => sport.id === activity.sport_id)
|
|
|
|
.map(sport => sport.label)} -{' '}
|
|
|
|
{activity.activity_date}
|
|
|
|
</Link>
|
|
|
|
</div>
|
|
|
|
<div className="card-body">
|
|
|
|
<p>
|
|
|
|
<i className="fa fa-calendar" aria-hidden="true" />{' '}
|
|
|
|
Start at {activity.activity_date}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<i className="fa fa-clock-o" aria-hidden="true" />{' '}
|
|
|
|
Duration: {activity.duration} -{' '}
|
|
|
|
<i className="fa fa-road" aria-hidden="true" />{' '}
|
|
|
|
Distance: {activity.distance} km
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|