({ pack })
| 16 | } |
| 17 | |
| 18 | const Statistics: React.FC<StatProps> = ({ pack }) => { |
| 19 | const { season, duration, duration_unit, gender, temp_range, id, title } = pack; |
| 20 | const durationValue = () => { |
| 21 | if (!duration) { |
| 22 | return null; |
| 23 | } |
| 24 | return `${duration} ${duration_unit}`; |
| 25 | }; |
| 26 | |
| 27 | const packUrl = `https://packstack.io${getPackPath(id, title)}`; |
| 28 | |
| 29 | return ( |
| 30 | <StatCollection> |
| 31 | <Stat label="Season" value={season} icon={<Icon component={CalendarIcon}/>}/> |
| 32 | <Stat label="Temp Range" value={temp_range} icon={<Icon component={TempIcon}/>}/> |
| 33 | <Stat label="Duration" value={durationValue()} icon={<Icon component={FootprintsIcon}/>}/> |
| 34 | <Stat label="Gender" value={getGenderName(gender)}/> |
| 35 | <Stat label="Pack URL" value={packUrl} icon={<Icon type="link"/>}/> |
| 36 | </StatCollection> |
| 37 | ) |
| 38 | |
| 39 | }; |
| 40 | |
| 41 | export default Statistics; |
nothing calls this directly
no test coverage detected