import { useEffect, useRef } from 'react'; import type { RowData } from '@tanstack/table-core'; import { DataTableContext } from './context.ts'; import { DataTableContent } from './DataTableContent.tsx'; import { createDataTableStore } from './store.ts'; import type { DataTableProps } from './types.ts'; export const DataTable = ({ disableSearch, emptyStateProps, onRowClick, onRowDoubleClick, onSearchChange, togglesComponent, ...props }: DataTableProps) => { const storeRef = useRef(createDataTableStore(props)); useEffect(() => { const { reset } = storeRef.current.getState(); reset(props); }, [props]); return ( ); }; export type { DataTableColumnBreakpoints, DataTableProps, DataTableRowAction, DataTableSearchChangeHandler } from './types.ts'; export * as TanstackTable from '@tanstack/table-core';