import React, { Component } from 'react';
import PropTypes from 'prop-types';
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 (
{blockedFiltering}
{getPercent(dnsQueries, blockedFiltering)}
Blocked by Filters
{replacedSafebrowsing}
{getPercent(dnsQueries, replacedSafebrowsing)}
Blocked malware/phishing
{replacedParental}
{getPercent(dnsQueries, replacedParental)}
Blocked adult websites
);
}
}
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 Statistics;