import { useMemo } from "react";
import { Form } from "antd";
import { isArr } from "@pisell/utils";
import Header from "../Table/tableConfig/header";
import Body from "../Table/tableConfig/body";
var useGenTableComponents = function useGenTableComponents(params) {
  var form = params.form;
  var group = Form.useWatch("group_by", {
    form: form,
    preserve: true
  });
  var isGroup = useMemo(function () {
    return isArr(group) && group.length > 0;
  }, [group]);
  return useMemo(function () {
    // if (isGroup) return undefined;
    return {
      header: {
        row: Header.Row,
        cell: Header.Cell
      },
      body: {
        row: Body.Row,
        cell: Body.Coll
      }
    };
  }, [isGroup]);
};
export default useGenTableComponents;