"use strict";var _interopRequireWildcard=require("@babel/runtime/helpers/interopRequireWildcard"),_interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")),_getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")),_inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),React=_interopRequireWildcard(require("react")),_classnames=_interopRequireDefault(require("classnames")),_helpers=require("../../helpers"),_withStyles=_interopRequireDefault(require("../../hoc/withStyles")),_ErrorBoundary=_interopRequireDefault(require("../../hoc/ErrorBoundary")),_styles=_interopRequireDefault(require("./styles")),CompanyCard=/*#__PURE__*/function(_React$Component){function CompanyCard(){return(0,_classCallCheck2.default)(this,CompanyCard),(0,_possibleConstructorReturn2.default)(this,(0,_getPrototypeOf2.default)(CompanyCard).apply(this,arguments))}return(0,_inherits2.default)(CompanyCard,_React$Component),(0,_createClass2.default)(CompanyCard,[{key:"_renderCard",value:function _renderCard(){var _this$props=this.props,classes=_this$props.classes,onClick=_this$props.onClick,secondaryLabel=_this$props.secondaryLabel,primaryLabel=_this$props.primaryLabel,imageUrl=_this$props.imageUrl,onSettingClick=_this$props.onSettingClick,isJoinedCompany=_this$props.isJoinedCompany;return React.createElement("div",{className:(0,_classnames.default)(classes.root),onClick:onClick},React.createElement("div",{className:(0,_classnames.default)(classes.upperPart)},!imageUrl&&React.createElement("div",{className:(0,_classnames.default)(classes.letterImage)},(0,_helpers.getFirstLetters)(primaryLabel||"")),imageUrl&&React.createElement("div",{className:(0,_classnames.default)(classes.cardImage)},React.createElement("img",{src:imageUrl,alt:"card image"})),React.createElement("div",{className:(0,_classnames.default)(classes.primaryLabel)},primaryLabel)),React.createElement("div",{className:(0,_classnames.default)(classes.lowerPart)},React.createElement("div",{className:(0,_classnames.default)(classes.secondaryLabel)},secondaryLabel),!isJoinedCompany&&React.createElement("div",{className:(0,_classnames.default)(classes.settingIcon),onClick:onSettingClick},React.createElement("i",{className:"icon icon-settings"}))))}},{key:"render",value:function render(){var classes=this.props.classes,componentClass=(0,_classnames.default)(classes.component);return React.createElement(_ErrorBoundary.default,null,React.createElement("div",{className:componentClass},this._renderCard()))}}]),CompanyCard}(React.Component);(0,_defineProperty2.default)(CompanyCard,"defaultProps",{onClick:function onClick(){},onSettingClick:function onSettingClick(){}});var _default=(0,_withStyles.default)(_styles.default)(CompanyCard);exports.default=_default;