import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { Trans, withNamespaces } from 'react-i18next'; import Card from '../ui/Card'; import Line from '../ui/Line'; import { getPercent } from '../../helpers/helpers'; import { STATUS_COLORS } from '../../helpers/constants'; class Statistics extends Component { render() { const { dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; return (
{dnsQueries}
dns_query
{blockedFiltering}
{getPercent(dnsQueries, blockedFiltering)}
blocked_by
{replacedSafebrowsing}
{getPercent(dnsQueries, replacedSafebrowsing)}
stats_malware_phishing
{replacedParental}
{getPercent(dnsQueries, replacedParental)}
stats_adult
); } } Statistics.propTypes = { history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, refreshButton: PropTypes.node.isRequired, }; export default withNamespaces()(Statistics);