"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const classNames = require("classnames");
const mobx_react_1 = require("mobx-react");
const PiLogging_1 = require("../../../util/PiLogging");
const React = require("react");
const styles = require("../styles/DropdownComponent.scss");
let DropdownItem = class DropdownItem extends React.Component {
    constructor() {
        super(...arguments);
        this.onClick = () => {
            PiLogging_1.EVENT_LOG.info(this, "onClick");
            if (this.props.onClick) {
                this.props.onClick(this.props.option);
            }
        };
        this.onMouseDown = (e) => {
            PiLogging_1.EVENT_LOG.info(this, "onMouseDown ");
            e.preventDefault();
        };
    }
    render() {
        let allClassNames = classNames({
            [styles.item]: true,
            [styles.currentlySelected]: this.props.selected
        });
        if (this.props.classNames && this.props.classNames.length !== 0) {
            allClassNames = classNames(allClassNames, this.props.classNames);
        }
        return (React.createElement("div", { className: allClassNames, key: "label", onMouseDown: this.onMouseDown, onClick: this.onClick, tabIndex: 0 }, this.props.option.label));
    }
};
DropdownItem = __decorate([
    mobx_react_1.observer
], DropdownItem);
exports.DropdownItem = DropdownItem;
//# sourceMappingURL=DropdownItem.js.map