42 lines
1.5 KiB
JavaScript
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 SkeletonAvatar = props => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
className,
|
|
rootClassName,
|
|
active,
|
|
shape = 'circle',
|
|
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', 'className']);
|
|
const cls = (0, _classnames.default)(prefixCls, `${prefixCls}-element`, {
|
|
[`${prefixCls}-active`]: active
|
|
}, className, rootClassName, hashId);
|
|
return wrapSSR( /*#__PURE__*/React.createElement("div", {
|
|
className: cls
|
|
}, /*#__PURE__*/React.createElement(_Element.default, Object.assign({
|
|
prefixCls: `${prefixCls}-avatar`,
|
|
shape: shape,
|
|
size: size
|
|
}, otherProps))));
|
|
};
|
|
var _default = exports.default = SkeletonAvatar; |