+ client: handle clients find
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { Fragment } from 'react';
|
||||
import { getClientInfo, getAutoClientInfo, normalizeWhois } from './helpers';
|
||||
import { normalizeWhois } from './helpers';
|
||||
import { WHOIS_ICONS } from './constants';
|
||||
|
||||
const getFormattedWhois = (whois, t) => {
|
||||
@@ -22,26 +22,29 @@ const getFormattedWhois = (whois, t) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const formatClientCell = (value, clients, autoClients, t) => {
|
||||
const clientInfo = getClientInfo(clients, value) || getAutoClientInfo(autoClients, value);
|
||||
const { name, whois } = clientInfo;
|
||||
export const formatClientCell = (row, t) => {
|
||||
const { value, original: { info } } = row;
|
||||
let whoisContainer = '';
|
||||
let nameContainer = value;
|
||||
|
||||
if (name) {
|
||||
nameContainer = (
|
||||
<span className="logs__text logs__text--wrap" title={`${name} (${value})`}>
|
||||
{name} <small>({value})</small>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
if (info) {
|
||||
const { name, whois } = info;
|
||||
|
||||
if (whois) {
|
||||
whoisContainer = (
|
||||
<div className="logs__text logs__text--wrap logs__text--whois">
|
||||
{getFormattedWhois(whois, t)}
|
||||
</div>
|
||||
);
|
||||
if (name) {
|
||||
nameContainer = (
|
||||
<span className="logs__text logs__text--wrap" title={`${name} (${value})`}>
|
||||
{name} <small>({value})</small>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
if (whois) {
|
||||
whoisContainer = (
|
||||
<div className="logs__text logs__text--wrap logs__text--whois">
|
||||
{getFormattedWhois(whois, t)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user