diff --git a/src/renderer/components/table/react-table.tsx b/src/renderer/components/table/react-table.tsx index 25f4610118..7d3320e0cb 100644 --- a/src/renderer/components/table/react-table.tsx +++ b/src/renderer/components/table/react-table.tsx @@ -5,31 +5,15 @@ import styles from "./react-table.module.scss"; import React from "react"; -import { - flexRender, - useReactTable, - getSortedRowModel, -} from '@tanstack/react-table' -import type { TableOptions, Table, SortingState } from "@tanstack/react-table"; +import { flexRender } from '@tanstack/react-table' +import type { Table } from "@tanstack/react-table"; -interface TableProps extends TableOptions { +interface TableProps { + table: Table; className?: string; } -export function Table({ columns, data, getCoreRowModel, className }: TableProps) { - const [sorting, setSorting] = React.useState([]) - - const table = useReactTable({ - data, - columns, - getCoreRowModel, - state: { - sorting, - }, - onSortingChange: setSorting, - getSortedRowModel: getSortedRowModel(), - }); - +export function Table({ className, table }: TableProps) { return (