You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
298 B
10 lines
298 B
import { DynamicTableItemProps } from '../components/DynamicTable';
|
|
|
|
export const prepareItems = <T = unknown>(
|
|
items: T[],
|
|
idCreator?: (item: T) => number | string
|
|
): Array<DynamicTableItemProps<T>> =>
|
|
items.map((item, index) => ({
|
|
id: idCreator?.(item) ?? index,
|
|
data: item,
|
|
}));
|
|
|