+ client: add whois info to clients and auto clients table

This commit is contained in:
Ildar Kamalov
2019-09-23 16:01:51 +03:00
committed by Simon Zolin
parent 192b58b9d9
commit 9e4f80f3c1
6 changed files with 90 additions and 22 deletions

View File

@@ -0,0 +1,38 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Trans } from 'react-i18next';
const getFormattedWhois = (value) => {
const keys = Object.keys(value);
if (keys.length > 0) {
return (
keys.map(key => (
<div key={key} title={value[key]}>
<Trans
values={{ value: value[key] }}
components={[<small key="0">text</small>]}
>
{key}
</Trans>
</div>
))
);
}
return '';
};
const WhoisCell = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text logs__text--wrap">
{getFormattedWhois(value)}
</span>
</div>
);
WhoisCell.propTypes = {
value: PropTypes.object.isRequired,
};
export default WhoisCell;