"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"));
{
    FieldLabelProps;
}
from;
'./types';
const prop_types_1 = __importDefault(require("prop-types"));
const withStyles_1 = __importDefault(require("components/hoc/withStyles"));
const ErrorBoundary_1 = __importDefault(require("components/hoc/ErrorBoundary"));
const styles_1 = __importDefault(require("./styles"));
class FieldLabel extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {};
    }
    render() {
        let { classes, label, extraLinkWithLabel } = this.props;
        return (React.createElement(ErrorBoundary_1.default, null,
            React.createElement("div", { className: classes.component }, (Boolean(label) || Boolean(extraLinkWithLabel)) && (React.createElement("div", { className: classes.wrapper },
                Boolean(label) && React.createElement("div", { className: classes.label }, label),
                Boolean(extraLinkWithLabel) && (React.createElement("div", { "data-test": `extra-link-with-label-${String(extraLinkWithLabel)}`, className: classes.linkWithLabel, onClick: this.props.onExtraLinkClicked }, extraLinkWithLabel)))))));
    }
}
FieldLabel.propTypes = {
    label: prop_types_1.default.string.isRequired,
    labelColor: prop_types_1.default.string,
    extraLinkWithLabel: prop_types_1.default.string,
    onExtraLinkClicked: prop_types_1.default.func,
    classes: prop_types_1.default.object,
};
FieldLabel.defaultProps = {
    extraLinkWithLabel: '',
    onExtraLinkClicked: () => { },
};
exports.default = withStyles_1.default(styles_1.default)(FieldLabel);
//# sourceMappingURL=index.js.map