diff --git a/webapp/channels/src/components/analytics/statistic_count.tsx b/webapp/channels/src/components/analytics/statistic_count.tsx index 75fb6885df..e6c8ce9391 100644 --- a/webapp/channels/src/components/analytics/statistic_count.tsx +++ b/webapp/channels/src/components/analytics/statistic_count.tsx @@ -15,47 +15,54 @@ type Props = { status?: 'warning' | 'error'; } -export default class StatisticCount extends React.PureComponent { - public render(): JSX.Element { - const loading = ( - - ); +const StatisticCount = ({ + title, + icon, + count, + id, + children, + status, +}: Props) => { + const loading = ( + + ); - return ( -
+ return ( +
+
-
- {this.props.title} - -
-
- {typeof this.props.count === 'undefined' || isNaN(this.props.count) ? loading : this.props.count} -
+ {title} + +
+
+ {typeof count === 'undefined' || isNaN(count) ? loading : count}
- {this.props.children}
- ); - } -} + {children} +
+ ); +}; + +export default React.memo(StatisticCount);