@wordpress/components
Version:
UI components for WordPress.
53 lines (49 loc) • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.CardBody = void 0;
var _context = require("../../context");
var _scrollable = require("../../scrollable");
var _view = require("../../view");
var _hook = require("./hook");
var _jsxRuntime = require("react/jsx-runtime");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
function UnconnectedCardBody(props, forwardedRef) {
const {
isScrollable,
...otherProps
} = (0, _hook.useCardBody)(props);
if (isScrollable) {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_scrollable.Scrollable, {
...otherProps,
ref: forwardedRef
});
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.View, {
...otherProps,
ref: forwardedRef
});
}
/**
* `CardBody` renders an optional content area for a `Card`.
* Multiple `CardBody` components can be used within `Card` if needed.
*
* ```jsx
* import { Card, CardBody } from `@wordpress/components`;
*
* <Card>
* <CardBody>
* ...
* </CardBody>
* </Card>
* ```
*/
const CardBody = exports.CardBody = (0, _context.contextConnect)(UnconnectedCardBody, 'CardBody');
var _default = exports.default = CardBody;
//# sourceMappingURL=component.js.map