import React from 'react'; import { defaultSortDesc, getTableColumnsStyles } from '../../utils/node-details-utils'; import { NODE_DETAILS_TABLE_CW, NODE_DETAILS_TABLE_XS_LABEL } from '../../constants/styles'; export default class NodeDetailsTableHeaders extends React.Component { handleClick(ev, headerId, currentSortedBy, currentSortedDesc) { ev.preventDefault(); const header = this.props.headers.find(h => h.id === headerId); const sortedBy = header.id; const sortedDesc = sortedBy === currentSortedBy ? !currentSortedDesc : defaultSortDesc(header); this.props.onClick(sortedBy, sortedDesc); } render() { const { headers, sortedBy, sortedDesc } = this.props; const colStyles = getTableColumnsStyles(headers); return (