2023-11-29 16:07:24 +00:00
|
|
|
import React from "react";
|
|
|
|
|
|
|
|
|
|
import { IOperatingSystemVersion } from "interfaces/operating_system";
|
|
|
|
|
|
|
|
|
|
import TableContainer from "components/TableContainer";
|
|
|
|
|
|
|
|
|
|
import { generateTableHeaders } from "./OSVersionTableConfig";
|
|
|
|
|
import OSVersionsEmptyState from "../OSVersionsEmptyState";
|
|
|
|
|
|
|
|
|
|
const baseClass = "os-version-table";
|
|
|
|
|
|
|
|
|
|
interface IOSVersionTableProps {
|
|
|
|
|
osVersionData: IOperatingSystemVersion[];
|
|
|
|
|
currentTeamId: number;
|
|
|
|
|
isLoading: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const DEFAULT_SORT_HEADER = "hosts_count";
|
|
|
|
|
const DEFAULT_SORT_DIRECTION = "desc";
|
|
|
|
|
|
|
|
|
|
const OSVersionTable = ({
|
|
|
|
|
osVersionData,
|
|
|
|
|
currentTeamId,
|
|
|
|
|
isLoading,
|
|
|
|
|
}: IOSVersionTableProps) => {
|
|
|
|
|
const columns = generateTableHeaders(currentTeamId);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className={baseClass}>
|
|
|
|
|
<TableContainer
|
2023-12-09 00:54:24 +00:00
|
|
|
columnConfigs={columns}
|
2023-11-29 16:07:24 +00:00
|
|
|
data={osVersionData}
|
|
|
|
|
isLoading={isLoading}
|
|
|
|
|
resultsTitle=""
|
|
|
|
|
emptyComponent={OSVersionsEmptyState}
|
|
|
|
|
showMarkAllPages={false}
|
|
|
|
|
isAllPagesSelected={false}
|
|
|
|
|
defaultSortHeader={DEFAULT_SORT_HEADER}
|
|
|
|
|
defaultSortDirection={DEFAULT_SORT_DIRECTION}
|
|
|
|
|
disableTableHeader
|
|
|
|
|
disableCount
|
|
|
|
|
disablePagination
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default OSVersionTable;
|