diff --git a/src/renderer/components/list/list.tsx b/src/renderer/components/list/list.tsx index d9add12257..0c07ce175c 100644 --- a/src/renderer/components/list/list.tsx +++ b/src/renderer/components/list/list.tsx @@ -9,7 +9,6 @@ import themeStyles from "./table-theme.module.scss"; import React, { useState } from "react"; import { SearchInput } from "../input"; import type { TableOptions } from '@tanstack/react-table' -import { getCoreRowModel } from '@tanstack/react-table' import { TableList } from "../table-list/table-list"; @@ -46,7 +45,6 @@ export function List({ columns, data, title, filters }: ListProps) { {filteredData.length == 0 && ( diff --git a/src/renderer/components/table-list/table-list.tsx b/src/renderer/components/table-list/table-list.tsx index 58d6644f45..b4af5e05ae 100644 --- a/src/renderer/components/table-list/table-list.tsx +++ b/src/renderer/components/table-list/table-list.tsx @@ -1,4 +1,4 @@ -import type { TableOptions, SortingState, Table as TableType } from "@tanstack/react-table"; +import type { TableOptions, SortingState, Table as TableType, ColumnDef } from "@tanstack/react-table"; import { useReactTable, getCoreRowModel, getSortedRowModel } from "@tanstack/react-table"; import React, { HTMLProps, useMemo } from "react"; import { createColumnHelper } from "@tanstack/react-table"; @@ -8,10 +8,13 @@ import { withInjectables } from "@ogre-tools/injectable-react"; import getRandomIdInjectable from "../../../common/utils/get-random-id.injectable"; import { VirtualTable } from "../table/virtual-table"; -interface TableProps extends TableOptions { +interface TableProps { + columns: ColumnDef[]; + data: T[]; className?: string; selectable?: boolean; configurable?: boolean; + columnsResizable?: boolean; } export function TableList({ @@ -20,6 +23,7 @@ export function TableList({ className, selectable = true, configurable = true, + columnsResizable = true, }: TableProps) { const [sorting, setSorting] = React.useState([]) const tableColumns = useMemo(() => { @@ -77,7 +81,7 @@ export function TableList({ }, onSortingChange: setSorting, getSortedRowModel: getSortedRowModel(), - enableColumnResizing: true, + enableColumnResizing: columnsResizable, columnResizeMode: 'onChange', defaultColumn: { size: 100,