UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

34 lines (30 loc) 1.38 kB
'use strict'; var tslib_es6 = require('../../node_modules/tslib/tslib.es6.js'); var React = require('react'); var PropTypes = require('prop-types'); var index = require('../../_virtual/index.js'); var props = require('../../props.js'); const CAvatar = React.forwardRef((_a, ref) => { var { children, className, color, shape, size, src, status, textColor } = _a, rest = tslib_es6.__rest(_a, ["children", "className", "color", "shape", "size", "src", "status", "textColor"]); const statusClassName = status && index.default('avatar-status', `bg-${status}`); return (React.createElement("div", Object.assign({ className: index.default('avatar', { [`bg-${color}`]: color, [`avatar-${size}`]: size, [`text-${textColor}`]: textColor, }, shape, className) }, rest, { ref: ref }), src ? React.createElement("img", { src: src, className: "avatar-img" }) : children, status && React.createElement("span", { className: statusClassName }))); }); CAvatar.propTypes = { children: PropTypes.node, className: PropTypes.string, color: props.colorPropType, shape: props.shapePropType, size: PropTypes.string, src: PropTypes.string, status: PropTypes.string, textColor: props.textColorsPropType, }; CAvatar.displayName = 'CAvatar'; exports.CAvatar = CAvatar; //# sourceMappingURL=CAvatar.js.map