FitTrackee/fittrackee_client_old/src/components/Dashboard/Statistics.jsx
2021-11-03 18:26:44 +01:00

35 lines
795 B
JavaScript

import { endOfMonth, startOfMonth } from 'date-fns'
import React from 'react'
import Stats from '../Common/Stats'
export default class Statistics extends React.Component {
constructor(props, context) {
super(props, context)
const date = new Date()
this.state = {
start: startOfMonth(date),
end: endOfMonth(date),
duration: 'week',
type: 'by_time',
}
}
render() {
const { t } = this.props
return (
<div className="card workout-card">
<div className="card-header">{t('dashboard:This month')}</div>
<div className="card-body">
<Stats
displayEmpty={false}
statsParams={this.state}
t={t}
withElevation={false}
/>
</div>
</div>
)
}
}