"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserMenu = void 0;
const react_1 = __importDefault(require("react"));
const react_router_dom_1 = require("react-router-dom");
const Dropdown_1 = require("../dropdown/Dropdown");
const UserMenu = ({ profile, signOutAndRedirect }) => {
    return (react_1.default.createElement(Dropdown_1.Dropdown, { className: 'user-menu-dropdown', label: react_1.default.createElement("div", { className: "user-menu-label" }, "My Account"), children: react_1.default.createElement("div", { className: "user-menu-dropdown-list" },
            react_1.default.createElement("ul", null,
                react_1.default.createElement("li", { className: "dropdown-header" },
                    react_1.default.createElement("p", null,
                        react_1.default.createElement("span", null, "Hello"),
                        " ",
                        react_1.default.createElement("br", null),
                        profile.name),
                    react_1.default.createElement("p", null,
                        react_1.default.createElement("span", null, "signed in as"),
                        react_1.default.createElement("br", null),
                        profile.email,
                        ' '),
                    react_1.default.createElement("p", null,
                        react_1.default.createElement("span", null, "via"),
                        react_1.default.createElement("br", null),
                        " ",
                        profile.provider)),
                react_1.default.createElement("li", null,
                    react_1.default.createElement(react_router_dom_1.Link, { to: "/search?mydatasets" }, "My Datasets")),
                react_1.default.createElement("li", { className: "user-menu-link" },
                    react_1.default.createElement(react_router_dom_1.Link, { to: "/keygen" }, " Obtain an API Key ")),
                profile.provider !== 'orcid' && (react_1.default.createElement("li", { className: "user-menu-link" },
                    react_1.default.createElement("a", { href: "/crn/auth/orcid?link=true" },
                        ' ',
                        "Link ORCID to my account",
                        ' '))),
                profile.admin && (react_1.default.createElement("li", { className: "user-menu-link" },
                    react_1.default.createElement(react_router_dom_1.Link, { to: "/admin" }, "Admin"))),
                react_1.default.createElement("li", { className: "user-menu-link" },
                    react_1.default.createElement("a", { onClick: () => signOutAndRedirect(), className: "btn-submit-other" }, "Sign Out")))) }));
};
exports.UserMenu = UserMenu;
