"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var react_1 = require("react");
var react_router_dom_1 = require("react-router-dom");
var react_hooks_1 = require("@devesharp/react-hooks");
var free_solid_svg_icons_1 = require("@fortawesome/free-solid-svg-icons");
var react_fontawesome_1 = require("@fortawesome/react-fontawesome");
var UserAvatar_1 = require("../UserAvatar");
var HeaderDesktopUserMenu = function (props) {
    var ref = react_1.useRef();
    react_hooks_1.useClickOutside(props.closeUserMenuInfo, ref);
    return (React.createElement(React.Fragment, null,
        React.createElement("div", { className: "container-user", onClick: props.toggleUserMenuInfo, onBlur: props.closeUserMenuInfo, ref: ref },
            React.createElement("div", { className: "username-container" },
                React.createElement("div", { className: "user-image-container" },
                    React.createElement(UserAvatar_1.UserAvatar, { user: props.user, size: "s" })),
                "Ol\u00E1, ",
                React.createElement("span", { className: "username" }, props.user.name),
                ' ',
                React.createElement(react_fontawesome_1.FontAwesomeIcon, { icon: free_solid_svg_icons_1.faChevronDown, flip: "horizontal" }),
                React.createElement("div", { className: "username-container-popup " + (!props.openUserMenuInfo || 'opened') },
                    React.createElement("div", { className: "ds-table", onClick: props.closeUserMenuInfo },
                        React.createElement("div", { className: "ds-cell" },
                            React.createElement(UserAvatar_1.UserAvatar, { user: props.user, size: "m" })),
                        React.createElement("div", { className: "ds-cell pl-2" },
                            React.createElement("div", { className: "name" }, props.user.name),
                            React.createElement("div", { className: "role" }, "Usu\u00E1rio"))),
                    React.createElement("div", { className: "ds-menu" }, !!props.menuUserBar &&
                        props.menuUserBar.map(function (item, i) { return (React.createElement(react_router_dom_1.NavLink, { key: item.route, className: "ds-item", to: { pathname: item.route }, exact: true }, item.title)); })))))));
};
exports.default = HeaderDesktopUserMenu;
//# sourceMappingURL=header--deskop-user-menu.js.map