UNPKG

@lifespikes/ui

Version:
19 lines (18 loc) 902 B
import { FC, ReactNode } from 'react'; import { ColumnDef, Table as TableType, TableOptions } from '@tanstack/react-table'; import { TableVariantProps } from '@lifespikes/ui/components'; export interface WithTable { table: TableType<Record<any, any>>; } export type RenderComponentDataTableHandler = (context: WithTable) => ReactNode; export interface DataTableProps<TData, TValue> extends TableVariantProps { data: TData[]; columns: ColumnDef<TData, TValue>[]; tableOptions?: Partial<TableOptions<Record<any, any>>>; renderHeader?: RenderComponentDataTableHandler; renderFooter?: RenderComponentDataTableHandler; variantClassName?: string; isLoading?: boolean; } export declare const DataTableLoading: FC<WithTable>; export declare const DataTable: <TData, TValue>({ data, columns, ...props }: DataTableProps<TData, TValue>) => import("react/jsx-runtime").JSX.Element;