"use strict";
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
/* @flow */
const React = __importStar(require("react"));
{
    CardProps;
}
from;
'./types';
const classnames_1 = __importDefault(require("classnames"));
const helpers_1 = require("components/helpers");
const withStyles_1 = __importDefault(require("components/hoc/withStyles"));
const ErrorBoundary_1 = __importDefault(require("components/hoc/ErrorBoundary"));
const styles_1 = __importDefault(require("./styles"));
class CompanyCard extends React.Component {
    _renderCard() {
        const { classes, onClick, secondaryLabel, primaryLabel, imageUrl, onSettingClick, isJoinedCompany, } = this.props;
        return (React.createElement("div", { className: classnames_1.default(classes.root), onClick: onClick },
            React.createElement("div", { className: classnames_1.default(classes.upperPart) },
                !imageUrl && (React.createElement("div", { className: classnames_1.default(classes.letterImage) }, helpers_1.getFirstLetters(primaryLabel || ''))),
                imageUrl && (React.createElement("div", { className: classnames_1.default(classes.cardImage) },
                    React.createElement("img", { src: imageUrl, alt: "card image" }))),
                React.createElement("div", { className: classnames_1.default(classes.primaryLabel) }, primaryLabel)),
            React.createElement("div", { className: classnames_1.default(classes.lowerPart) },
                React.createElement("div", { className: classnames_1.default(classes.secondaryLabel) }, secondaryLabel),
                !isJoinedCompany && (React.createElement("div", { className: classnames_1.default(classes.settingIcon), onClick: onSettingClick },
                    React.createElement("i", { className: 'icon icon-settings' }))))));
    }
    render() {
        let { classes } = this.props;
        let componentClass = classnames_1.default(classes.component);
        return (React.createElement(ErrorBoundary_1.default, null,
            React.createElement("div", { className: componentClass }, this._renderCard())));
    }
}
CompanyCard.defaultProps = {
    onClick: () => { },
    onSettingClick: () => { },
};
exports.default = withStyles_1.default(styles_1.default)(CompanyCard);
//# sourceMappingURL=index.js.map