import React from "react";
import { IMdmSolution } from "interfaces/mdm";
import TextCell from "components/TableContainer/DataTable/TextCell";
import ViewAllHostsLink from "components/ViewAllHostsLink";
import TooltipWrapper from "components/TooltipWrapper";
import HeaderCell from "components/TableContainer/DataTable/HeaderCell";
// NOTE: cellProps come from react-table
// more info here https://react-table.tanstack.com/docs/api/useTable#cell-properties
interface IMDMSolutionWithPlatformId extends IMdmSolution {
selectedPlatformLabelId?: number;
}
interface ICellProps {
cell: {
value: string;
};
row: {
original: IMDMSolutionWithPlatformId;
};
}
interface IHeaderProps {
column: {
title: string;
isSortedDesc: boolean;
};
}
interface IDataColumn {
title: string;
Header: ((props: IHeaderProps) => JSX.Element) | string;
accessor: string;
Cell: (props: ICellProps) => JSX.Element;
disableGlobalFilter?: boolean;
disableHidden?: boolean;
disableSortBy?: boolean;
}
export const generateSolutionsTableHeaders = (
teamId?: number
): IDataColumn[] => [
{
title: "Server URL",
Header: (): JSX.Element => {
const titleWithToolTip = (