ikoncomponents 1.8.3 → 1.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,8 +56,7 @@ export interface DecodedAccessToken {
|
|
|
56
56
|
iat: number;
|
|
57
57
|
exp: number;
|
|
58
58
|
}
|
|
59
|
-
export declare const MainSidebar: ({ baseUrl, platformUrl,
|
|
59
|
+
export declare const MainSidebar: ({ baseUrl, platformUrl, }: {
|
|
60
60
|
baseUrl: string;
|
|
61
61
|
platformUrl: string;
|
|
62
|
-
releaseOpsUrl?: string;
|
|
63
62
|
}) => React.JSX.Element;
|
|
@@ -16,7 +16,8 @@ import Link from "next/link";
|
|
|
16
16
|
import { jwtDecode } from "jwt-decode";
|
|
17
17
|
import { Icon } from "../icon";
|
|
18
18
|
import { useRefresh } from "./RefreshContext";
|
|
19
|
-
export const MainSidebar = ({ baseUrl, platformUrl,
|
|
19
|
+
export const MainSidebar = ({ baseUrl, platformUrl,
|
|
20
|
+
// releaseOpsUrl = "https://ikon-dev.keross.com/",
|
|
20
21
|
// baseUrl = "https://api.nexicron.com",
|
|
21
22
|
}) => {
|
|
22
23
|
const [user, setUser] = React.useState();
|
|
@@ -128,9 +129,9 @@ export const MainSidebar = ({ baseUrl, platformUrl, releaseOpsUrl = "https://iko
|
|
|
128
129
|
const hasIcon = Boolean(software.icon && software.icon.trim() !== "");
|
|
129
130
|
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs(Link, { href: (_a = software.url) !== null && _a !== void 0 ? _a : "#", children: [hasIcon ? (_jsx(Icon, { name: toPascalCase((_b = software.icon) !== null && _b !== void 0 ? _b : ""), className: "h-8 w-8 shrink-0" })) : (_jsx(FolderCode, { className: "h-8 w-8 shrink-0" })), expanded ? (_jsx("span", { className: "truncate text-sm", children: software.displayName })) : (_jsx("span", { className: "sr-only", children: software.displayName }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: software.displayName }))] }, software.displayName));
|
|
130
131
|
}) }), ((roles === null || roles === void 0 ? void 0 : roles.includes("ADMIN")) || (roles === null || roles === void 0 ? void 0 : roles.includes("DEVELOPER")) || (roles === null || roles === void 0 ? void 0 : roles.includes("SUPERADMIN"))) && (_jsx(_Fragment, { children: [
|
|
131
|
-
{ key: "Release Ops", label: "Release Ops", href: `${
|
|
132
|
-
{ key: "IKON Studio", label: "IKON Studio", href: `${
|
|
133
|
-
{ key: "IKON AI Workforce", label: "IKON AI Workforce", href: `${
|
|
132
|
+
{ key: "Release Ops", label: "Release Ops", href: `${platformUrl}/devtools/`, icon: LoaderPinwheel },
|
|
133
|
+
{ key: "IKON Studio", label: "IKON Studio", href: `${platformUrl}/ikon-studio`, icon: Palette },
|
|
134
|
+
{ key: "IKON AI Workforce", label: "IKON AI Workforce", href: `${platformUrl}/ikon-ai-workforce`, icon: Bot },
|
|
134
135
|
].map(({ key, label, href, icon: LinkIcon }) => (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", children: [_jsx(LinkIcon, { className: "h-8 w-8 shrink-0" }), expanded ? (_jsx("span", { className: "truncate text-sm", children: label })) : (_jsx("span", { className: "sr-only", children: label }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: label }))] }, key))) })), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), asChild: true, children: _jsxs(Link, { href: `${platformUrl}/settings`, children: [_jsx(Settings, { className: "h-8 w-8 shrink-0" }), expanded ? (_jsx("span", { className: "truncate text-sm", children: "Settings" })) : (_jsx("span", { className: "sr-only", children: "Settings" }))] }) }) }), !expanded && (_jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Settings" }))] }, "settings"), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "icon", className: cn("h-10", expanded ? "w-full justify-start gap-3 px-3" : "w-10"), children: [_jsx(CircleUserRound, { className: "h-8 w-8 shrink-0" }), expanded && (_jsx("span", { className: "truncate text-sm font-medium", children: (user === null || user === void 0 ? void 0 : user.userName) || "Profile" }))] }) }), _jsxs(DropdownMenuContent, { className: "w-55 p-0", side: "right", sideOffset: 8, children: [_jsxs("div", { className: "flex items-start gap-3 p-4 bg-card", children: [_jsx(CircleUserRound, { className: "h-8 w-8" }), _jsxs("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [_jsx("p", { className: "text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userName }), _jsx("p", { className: "text-xs text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userEmail }), _jsx("p", { className: "text-sm text-muted-foreground font-semibold", children: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountName })] })] }), _jsx(DropdownMenuSeparator, { className: "my-0" }), _jsxs(DropdownMenuItem, { onClick: async () => {
|
|
135
136
|
await clearAllCookieSession();
|
|
136
137
|
redirect(`${platformUrl}/login.html`);
|