import { jsxs, jsx } from "react/jsx-runtime";
/* empty css                                                                                                                                                                                                */
import { MantineReactTable } from "../../../node_modules/.pnpm/mantine-react-table@2.0.0-beta.7_@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@_6pmziqsvipqgt5gv2plqw5hct4/node_modules/mantine-react-table/dist/index.esm.mjs";
/* empty css                                                                                                                                                                                          */
/* empty css                                                                                                                                                                                           */
/* empty css                                                                                                                                                                                                   */
/* empty css                                                                                                                                                                                              */
/* empty css                                                                                                                                                                                              */
import { ProTablePagination } from "../TablePagination.mjs";
import { useProTable } from "./helpers.mjs";
import { Box } from "../../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/Box/Box.mjs";
const isTableInstanceProp = (props) => props.table !== void 0;
const ProTable = (props) => {
  const isInstance = isTableInstanceProp(props);
  let table = useProTable(isInstance ? { columns: [], data: [] } : props);
  if (isInstance) {
    table = props.table;
  }
  return /* @__PURE__ */ jsxs(Box, { ...props.wrapperProps || table.wrapperProps, children: [
    /* @__PURE__ */ jsx(MantineReactTable, { table }),
    table.options.enablePagination && /* @__PURE__ */ jsx(ProTablePagination, { table, ...table.pagination || props.pagination })
  ] });
};
export {
  ProTable
};
