var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef, version } from "react";
import { useDataGridContext } from "../../../data-grid/root/DataGridRoot.context.js";
import { cl } from "../../../utils/helpers/index.js";
import { DataTableLocationProvider, useDataTableContext, } from "../root/DataTableRoot.context.js";
const inertValue = parseInt(version.split(".")[0], 10) > 18 ? true : ""; // Support for inert was added in React 19
const DataTableTbody = forwardRef((_a, forwardedRef) => {
    var { className } = _a, rest = __rest(_a, ["className"]);
    const { isLoading } = useDataGridContext();
    const { loading } = useDataTableContext();
    return (React.createElement(DataTableLocationProvider, { location: "tbody" },
        React.createElement("tbody", Object.assign({}, rest, { ref: forwardedRef, className: cl("aksel-data-table__tbody", className), 
            // @ts-expect-error - inert is not yet recognized by React's type definitions, but we want to use it for better accessibility when showing the loading overlay.
            inert: isLoading && (loading === null || loading === void 0 ? void 0 : loading.variant) === "overlay" ? inertValue : false }))));
});
export { DataTableTbody };
//# sourceMappingURL=DataTableTbody.js.map