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.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@_5svcobtrqecafhl2xknqvpxgpq/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.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/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
};
