amis-rpc-design/node_modules/antd/lib/skeleton/Button.js
2023-10-07 19:42:30 +08:00

42 lines
1.5 KiB
JavaScript

"use strict";
"use client";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _classnames = _interopRequireDefault(require("classnames"));
var _omit = _interopRequireDefault(require("rc-util/lib/omit"));
var React = _interopRequireWildcard(require("react"));
var _configProvider = require("../config-provider");
var _Element = _interopRequireDefault(require("./Element"));
var _style = _interopRequireDefault(require("./style"));
const SkeletonButton = props => {
const {
prefixCls: customizePrefixCls,
className,
rootClassName,
active,
block = false,
size = 'default'
} = props;
const {
getPrefixCls
} = React.useContext(_configProvider.ConfigContext);
const prefixCls = getPrefixCls('skeleton', customizePrefixCls);
const [wrapSSR, hashId] = (0, _style.default)(prefixCls);
const otherProps = (0, _omit.default)(props, ['prefixCls']);
const cls = (0, _classnames.default)(prefixCls, `${prefixCls}-element`, {
[`${prefixCls}-active`]: active,
[`${prefixCls}-block`]: block
}, className, rootClassName, hashId);
return wrapSSR( /*#__PURE__*/React.createElement("div", {
className: cls
}, /*#__PURE__*/React.createElement(_Element.default, Object.assign({
prefixCls: `${prefixCls}-button`,
size: size
}, otherProps))));
};
var _default = exports.default = SkeletonButton;