import React from 'react' export default function UserStatistics (props) { const { user } = props const days = user.total_duration.match(/day/g) ? `${user.total_duration.split(',')[0]},` : '0 days,' let duration = user.total_duration.match(/day/g) ? user.total_duration.split(', ')[1] : user.total_duration duration = `${duration.split(':')[0]}h ${duration.split(':')[1]}min` return (