mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
* rework data table, got to point of calling network request correctly * got to point of rendering table columns and data * finish up functional changes to data table * fix tests * fix styles for table container and data table * clean up some styles * update to styles for no host configured * cleanup and docs * add missing method for host table text formatting * disabling unused test. will add back in next PR * clean up code
34 lines
700 B
TypeScript
34 lines
700 B
TypeScript
import React from 'react';
|
|
|
|
interface IHeaderCellProps {
|
|
value: string;
|
|
isSortedDesc?: boolean;
|
|
}
|
|
|
|
const HeaderCell = (props: IHeaderCellProps): JSX.Element => {
|
|
const {
|
|
value,
|
|
isSortedDesc,
|
|
} = props;
|
|
|
|
let sortArrowClass = '';
|
|
if (isSortedDesc === undefined) {
|
|
sortArrowClass = '';
|
|
} else if (isSortedDesc) {
|
|
sortArrowClass = 'descending';
|
|
} else {
|
|
sortArrowClass = 'ascending';
|
|
}
|
|
|
|
return (
|
|
<div className={`header-cell ${sortArrowClass}`}>
|
|
<span>{value}</span>
|
|
<div className="sort-arrows">
|
|
<span className="ascending-arrow" />
|
|
<span className="descending-arrow" />
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default HeaderCell;
|