import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; import ReactTable from 'react-table'; import Card from '../../ui/Card'; import CellWrap from '../../ui/CellWrap'; import whoisCell from './whoisCell'; import LogsSearchLink from '../../ui/LogsSearchLink'; const COLUMN_MIN_WIDTH = 200; class AutoClients extends Component { columns = [ { Header: this.props.t('table_client'), accessor: 'ip', minWidth: COLUMN_MIN_WIDTH, Cell: CellWrap, }, { Header: this.props.t('table_name'), accessor: 'name', minWidth: COLUMN_MIN_WIDTH, Cell: CellWrap, }, { Header: this.props.t('source_label'), accessor: 'source', minWidth: COLUMN_MIN_WIDTH, Cell: CellWrap, }, { Header: this.props.t('whois'), accessor: 'whois_info', minWidth: COLUMN_MIN_WIDTH, Cell: whoisCell(this.props.t), }, { Header: this.props.t('requests_count'), accessor: (row) => this.props.normalizedTopClients.auto[row.ip] || 0, sortMethod: (a, b) => b - a, id: 'statistics', minWidth: COLUMN_MIN_WIDTH, Cell: (row) => { const { value: clientStats } = row; if (clientStats) { return (