add enum for icons types
[arvados-workbench2.git] / src / components / data-table / data-table.tsx
index e96839e5d7891b4fff3ffca1baf3f4daa7421023..5372128f316613d41c9aa7758ba8b978dc97c5dc 100644 (file)
@@ -7,7 +7,7 @@ import { Table, TableBody, TableRow, TableCell, TableHead, TableSortLabel, Style
 import { DataColumn, SortDirection } from './data-column';
 import DataTableFilters, { DataTableFilterItem } from "../data-table-filters/data-table-filters";
 
-export type DataColumns<T> = Array<DataColumn<T>>;
+export type DataColumns<T, F extends DataTableFilterItem = DataTableFilterItem> = Array<DataColumn<T, F>>;
 export interface DataItem {
     key: React.Key;
 }
@@ -54,8 +54,8 @@ class DataTable<T extends DataItem> extends React.Component<DataTableProps<T> &
                     </DataTableFilters>
                     : sortDirection
                         ? <TableSortLabel
-                            active={sortDirection !== "none"}
-                            direction={sortDirection !== "none" ? sortDirection : undefined}
+                            active={sortDirection !== SortDirection.None}
+                            direction={sortDirection !== SortDirection.None ? sortDirection : undefined}
                             onClick={() =>
                                 onSortToggle &&
                                 onSortToggle(column)}>