(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "react", "./styles", "./LeadContent", "./TrailContent"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var tslib_1 = require("tslib");
    var react_1 = (0, tslib_1.__importDefault)(require("react"));
    var styles_1 = require("./styles");
    var LeadContent_1 = (0, tslib_1.__importDefault)(require("./LeadContent"));
    var TrailContent_1 = (0, tslib_1.__importDefault)(require("./TrailContent"));
    var ListItem = react_1.default.forwardRef(function (_a, ref) {
        var children = _a.children, className = _a.className, style = _a.style, trailIcon = _a.trailIcon, _b = _a.isSelected, isSelected = _b === void 0 ? false : _b, onClick = _a.onClick, isDisabled = _a.isDisabled, leadIcon = _a.leadIcon, leadContent = _a.leadContent, trailContent = _a.trailContent, onDoubleClick = _a.onDoubleClick, _c = _a.size, size = _c === void 0 ? "l" : _c, props = (0, tslib_1.__rest)(_a, ["children", "className", "style", "trailIcon", "isSelected", "onClick", "isDisabled", "leadIcon", "leadContent", "trailContent", "onDoubleClick", "size"]);
        var handleClick = function (event) {
            !isDisabled && (onClick === null || onClick === void 0 ? void 0 : onClick(event));
        };
        var handleDoubleClick = function (event) {
            !isDisabled && (onDoubleClick === null || onDoubleClick === void 0 ? void 0 : onDoubleClick(event));
        };
        return (react_1.default.createElement(styles_1.ListItemStyled, (0, tslib_1.__assign)({ as: "li", ref: ref, className: className, style: style, onClick: handleClick, onDoubleClick: handleDoubleClick, isSelected: isSelected, isDisabled: isDisabled, size: size, "data-element": "list-item" }, props),
            react_1.default.createElement("div", { className: "list-item__lead-content" },
                react_1.default.createElement(LeadContent_1.default, { leadIcon: leadIcon, leadContent: leadContent }),
                children),
            react_1.default.createElement(TrailContent_1.default, { trailIcon: trailIcon, trailContent: trailContent })));
    });
    ListItem.displayName = "ListItem";
    exports.default = ListItem;
});
