@helpscout/hsds-react
Version:
React component library for Help Scout's Design System
67 lines (47 loc) • 2.29 kB
JavaScript
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _getValidProps = _interopRequireDefault(require("@helpscout/react-utils/dist/getValidProps"));
var _classnames = _interopRequireDefault(require("classnames"));
var _ChatList = _interopRequireDefault(require("./ChatList.BlankSlate"));
var _ChatList2 = _interopRequireDefault(require("./ChatList.Item"));
var _ChatList3 = require("./ChatList.css");
var _jsxRuntime = require("react/jsx-runtime");
var ChatList = /*#__PURE__*/function (_React$Component) {
(0, _inheritsLoose2.default)(ChatList, _React$Component);
function ChatList() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = ChatList.prototype;
_proto.render = function render() {
var _this$props = this.props,
children = _this$props.children,
className = _this$props.className,
rest = (0, _objectWithoutPropertiesLoose2.default)(_this$props, ["children", "className"]);
var componentClassName = (0, _classnames.default)('c-ChatList', className);
var contentMarkup = _react.default.Children.count(children) ? children : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatList.default, {});
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatList3.ChatListUI, (0, _extends2.default)({}, (0, _getValidProps.default)(rest), {
className: componentClassName,
children: contentMarkup
}));
};
return ChatList;
}(_react.default.Component);
ChatList.BlankSlate = _ChatList.default;
ChatList.Item = _ChatList2.default;
ChatList.defaultProps = {
'data-cy': 'ChatList'
};
ChatList.propTypes = {
className: _propTypes.default.string,
/** Data attr for Cypress tests. */
'data-cy': _propTypes.default.string
};
var _default = ChatList;
exports.default = _default;
;