@sms-frontend/components
Version:
SMS Design React UI Library.
12 lines (11 loc) • 489 B
TypeScript
import { Key } from 'react';
import { TableProps, GetRowKeyType } from '../interface';
export default function useRowSelection<T>(props: TableProps<T>, data: any, getRowKey: GetRowKeyType<T>): {
selectedRowKeys: Key[];
onCheckAll: (checked: any) => void;
onCheck: (checked: any, record: any) => void;
onCheckRadio: (key: any, record: any) => void;
setSelectedRowKeys: React.Dispatch<React.SetStateAction<Key[]>>;
allSelectedRowKeys: Key[];
flattenData: T[];
};