import { deepMerge } from '#/utils';

export * from './form';
export * from './vxe-table';

export const useTableGridOptions = (
  options: Record<string, any>,
): Record<string, any> => {
  const defaultOptions = {
    gridOptions: {
      toolbarConfig: {
        refresh: true,
        print: false,
        export: false,
        zoom: true,
        custom: true,
      },
      height: 'auto',
      keepSource: true,
    },
  };

  return deepMerge(defaultOptions, options);
};

export const useFormOptions = (
  options: Record<string, any>,
): Record<string, any> => {
  const defaultOptions = {
    showDefaultActions: false,
    commonConfig: {
      componentProps: {
        class: 'w-full',
      },
    },
    wrapperClass: 'grid-cols-1',
  };

  return deepMerge(defaultOptions, options);
};
