+ client: add whois info to clients and auto clients table
This commit is contained in:
committed by
Simon Zolin
parent
192b58b9d9
commit
9e4f80f3c1
38
client/src/components/Settings/Clients/WhoisCell.js
Normal file
38
client/src/components/Settings/Clients/WhoisCell.js
Normal 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;
|
||||
Reference in New Issue
Block a user