import React from "react";
import { Link } from "react-router-dom";
import { Dropdown } from "../dropdown/Dropdown";
export const UserMenu = ({ profile, signOutAndRedirect }) => {
    return (React.createElement(Dropdown, { className: "user-menu-dropdown", label: React.createElement("div", { className: "user-menu-label" }, "My Account"), children: React.createElement("div", { className: "user-menu-dropdown-list" },
            React.createElement("ul", null,
                React.createElement("li", { className: "dropdown-header" },
                    React.createElement("p", null,
                        React.createElement("span", null, "Hello"),
                        " ",
                        React.createElement("br", null),
                        profile.name),
                    React.createElement("p", null,
                        React.createElement("span", null, "signed in as"),
                        React.createElement("br", null),
                        profile.email,
                        " "),
                    React.createElement("p", null,
                        React.createElement("span", null, "via"),
                        React.createElement("br", null),
                        " ",
                        profile.provider)),
                React.createElement("li", null,
                    React.createElement(Link, { to: "/search?mydatasets" }, "My Datasets")),
                React.createElement("li", { className: "user-menu-link" },
                    React.createElement(Link, { to: "/keygen" }, "Obtain an API Key")),
                profile.provider !== "orcid" && (React.createElement("li", { className: "user-menu-link" },
                    React.createElement("a", { href: "/crn/auth/orcid?link=true" },
                        " ",
                        "Link ORCID to my account",
                        " "))),
                profile.admin && (React.createElement("li", { className: "user-menu-link" },
                    React.createElement(Link, { to: "/admin" }, "Admin"))),
                React.createElement("li", { className: "user-menu-link" },
                    React.createElement("a", { onClick: () => signOutAndRedirect(), className: "btn-submit-other" }, "Sign Out")))) }));
};
