"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { cnb } from "cnbuilder";
import { forwardRef, useMemo } from "react";
import { TableConfigProvider, useTableConfig } from "./TableConfigurationProvider.js";
/**
 * **Client Component**
 *
 * Creates a `<tbody>` element that also allows for overriding all the child
 * `TableCell` components with additional styling behavior.
 *
 * @see {@link https://react-md.dev/components/table | Table Demos}
 */ export const TableBody = /*#__PURE__*/ forwardRef(function TableBody(props, ref) {
    const { className, children, hAlign: propHAlign, vAlign: propVAlign, lineWrap: propLineWrap, disableHover: propDisableHover, disableBorders: propDisableBorders, ...remaining } = props;
    // update the table configuration with the custom overrides for the `<thead>`
    const { dense, hAlign, vAlign, lineWrap, disableHover, disableBorders } = useTableConfig({
        hAlign: propHAlign,
        vAlign: propVAlign,
        lineWrap: propLineWrap,
        disableHover: propDisableHover,
        disableBorders: propDisableBorders
    });
    const configuration = useMemo(()=>({
            header: false,
            dense,
            hAlign,
            vAlign,
            lineWrap,
            disableBorders,
            disableHover
        }), [
        dense,
        hAlign,
        vAlign,
        lineWrap,
        disableBorders,
        disableHover
    ]);
    return /*#__PURE__*/ _jsx(TableConfigProvider, {
        value: configuration,
        children: /*#__PURE__*/ _jsx("tbody", {
            ...remaining,
            ref: ref,
            className: cnb("rmd-tbody", className),
            children: children
        })
    });
});

//# sourceMappingURL=TableBody.js.map