import r from"@babel/runtime/helpers/classCallCheck";import e from"@babel/runtime/helpers/createClass";import t from"@babel/runtime/helpers/assertThisInitialized";import o from"@babel/runtime/helpers/inherits";import n from"@babel/runtime/helpers/possibleConstructorReturn";import i from"@babel/runtime/helpers/getPrototypeOf";import s from"@babel/runtime/helpers/defineProperty";import{createRef as a,PureComponent as c}from"react";import p from"prop-types";import{withStyles as l}from"@material-ui/core/styles";import u from"./LoadingIndicator/LoadingIndicator.js";import m from"./CommentWrapper.js";import{jsx as f}from"react/jsx-runtime";function d(r){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}();return function(){var t,o=i(r);if(e){var s=i(this).constructor;t=Reflect.construct(o,arguments,s)}else t=o.apply(this,arguments);return n(this,t)}}var h={loadingIndicatorWrapper:{padding:"0 20px 0 0"}},b=function(n){o(p,c);var i=d(p);function p(e){var o;return r(this,p),o=i.call(this,e),s(t(o),"showIntoView",(function(){o.commentLoaderEl.current.scrollIntoView({block:"end"})})),o.commentLoaderEl=a(),o}return e(p,[{key:"componentDidMount",value:function(){this.props.showOnMount&&this.showIntoView()}},{key:"render",value:function(){return f("div",{ref:this.commentLoaderEl,children:f(m,{spaceAround:this.props.spaceAround,isLoader:!0,className:this.props.classes.commentWrapper,children:f("div",{style:h.loadingIndicatorWrapper,children:f(u,{fullscreen:!1,size:30})})})})}}]),p}();b.propTypes={showOnMount:p.bool,spaceAround:p.bool,classes:p.shape({}).isRequired},b.defaultProps={showOnMount:!1,spaceAround:!1};var y=l({commentWrapper:{width:"calc(100% - 28px)"}})(b);export{y as default};
