|
@@ -11,7 +11,7 @@ import TablePagination, { |
|
|
TablePaginationProps, |
|
|
TablePaginationProps, |
|
|
} from "@mui/material/TablePagination"; |
|
|
} from "@mui/material/TablePagination"; |
|
|
import TableRow from "@mui/material/TableRow"; |
|
|
import TableRow from "@mui/material/TableRow"; |
|
|
import IconButton from "@mui/material/IconButton"; |
|
|
|
|
|
|
|
|
import IconButton, { IconButtonOwnProps, IconButtonPropsColorOverrides } from "@mui/material/IconButton"; |
|
|
|
|
|
|
|
|
export interface ResultWithId { |
|
|
export interface ResultWithId { |
|
|
id: string | number; |
|
|
id: string | number; |
|
@@ -20,6 +20,7 @@ export interface ResultWithId { |
|
|
interface BaseColumn<T extends ResultWithId> { |
|
|
interface BaseColumn<T extends ResultWithId> { |
|
|
name: keyof T; |
|
|
name: keyof T; |
|
|
label: string; |
|
|
label: string; |
|
|
|
|
|
color?: IconButtonOwnProps["color"]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
interface ColumnWithAction<T extends ResultWithId> extends BaseColumn<T> { |
|
|
interface ColumnWithAction<T extends ResultWithId> extends BaseColumn<T> { |
|
@@ -91,7 +92,7 @@ function SearchResults<T extends ResultWithId>({ |
|
|
<TableCell key={`${columnName.toString()}-${idx}`}> |
|
|
<TableCell key={`${columnName.toString()}-${idx}`}> |
|
|
{isActionColumn(column) ? ( |
|
|
{isActionColumn(column) ? ( |
|
|
<IconButton |
|
|
<IconButton |
|
|
color="primary" |
|
|
|
|
|
|
|
|
color={column.color ?? "primary"} |
|
|
onClick={() => column.onClick(item)} |
|
|
onClick={() => column.onClick(item)} |
|
|
> |
|
|
> |
|
|
{column.buttonIcon} |
|
|
{column.buttonIcon} |
|
|