mirror of https://github.com/portainer/portainer
20 lines
417 B
TypeScript
20 lines
417 B
TypeScript
import { TableOptions } from '@tanstack/react-table';
|
|
|
|
import { DefaultType } from '../types';
|
|
|
|
import { OptionsExtension } from './types';
|
|
|
|
export function withMeta<D extends DefaultType>(
|
|
meta: Record<string, unknown>
|
|
): OptionsExtension<D> {
|
|
return function extendOptions(options: TableOptions<D>) {
|
|
return {
|
|
...options,
|
|
meta: {
|
|
...options.meta,
|
|
...meta,
|
|
},
|
|
};
|
|
};
|
|
}
|