openreplay/frontend/app/components/Dashboard/Widgets/UserActivity.js
Shekar Siri 2ed5cac986
Webpack upgrade and dependency cleanup (#523)
* change(ui) - webpack update
* change(ui) - api optimize and other fixes
2022-06-03 16:47:38 +02:00

31 lines
945 B
JavaScript

import React from 'react';
import { msToMin } from 'App/date';
import { Loader } from 'UI';
import { CountBadge, Divider, widgetHOC } from './common';
@widgetHOC('userActivity')
export default class UserActivity extends React.PureComponent {
render() {
const { data, loading } = this.props;
return (
<div className="flex justify-around items-center flex-1 flex-shrink-0">
<Loader loading={ loading } size="small">
<CountBadge
title="Avg. no. of Visited Pages"
icon="file"
count={ data.avgVisitedPages }
change={ data.avgVisitedPagesProgress }
/>
<Divider />
<CountBadge
title="Avg. Session Duration"
icon="clock"
unit="min"
count={ msToMin(data.avgDuration) }
change={ data.avgDurationProgress }
/>
</Loader>
</div>
);
}
}