// packages/components/src/card/card-body/hook.ts
import { useMemo } from "@wordpress/element";
import { useContextSystem } from "../../context/index.js";
import * as styles from "../styles.js";
import { useCx } from "../../utils/hooks/use-cx.js";
import { getPaddingBySize } from "../get-padding-by-size.js";
function useCardBody(props) {
  const {
    className,
    isScrollable = false,
    isShady = false,
    size = "medium",
    ...otherProps
  } = useContextSystem(props, "CardBody");
  const cx = useCx();
  const classes = useMemo(() => cx(
    styles.Body,
    styles.borderRadius,
    getPaddingBySize(size),
    isShady && styles.shady,
    // This classname is added for legacy compatibility reasons.
    "components-card__body",
    className
  ), [className, cx, isShady, size]);
  return {
    ...otherProps,
    className: classes,
    isScrollable
  };
}
export {
  useCardBody
};
//# sourceMappingURL=hook.js.map
