mirror of
https://github.com/fleetdm/fleet
synced 2026-05-18 22:49:19 +00:00
* add prettier and have it format all js code except website: : * trying running prettier check in CI * fix runs on in CI * change CI job name * fix prettier erros and fix CI
31 lines
782 B
JavaScript
31 lines
782 B
JavaScript
import React, { Component } from "react";
|
|
import { isEqual, omit } from "lodash";
|
|
|
|
import queryResultInterface from "interfaces/query_result";
|
|
|
|
class QueryResultsRow extends Component {
|
|
static propTypes = {
|
|
queryResult: queryResultInterface.isRequired,
|
|
};
|
|
|
|
shouldComponentUpdate(nextProps) {
|
|
return !isEqual(this.props.queryResult, nextProps.queryResult);
|
|
}
|
|
|
|
render() {
|
|
const { queryResult } = this.props;
|
|
const { host_hostname: hostHostname } = queryResult;
|
|
const queryColumns = omit(queryResult, ["host_hostname"]);
|
|
|
|
return (
|
|
<tr>
|
|
<td>{hostHostname}</td>
|
|
{Object.keys(queryColumns).map((col) => {
|
|
return <td key={col}>{queryColumns[col]}</td>;
|
|
})}
|
|
</tr>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default QueryResultsRow;
|