ikoncomponents 1.8.2 → 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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { Check, CircleUserRound, FolderCode, Home, LoaderPinwheel, LogOut, PanelLeftClose, PanelLeftOpen, Settings, } from "lucide-react";
|
|
4
|
+
import { Bot, Check, CircleUserRound, FolderCode, Home, LoaderPinwheel, LogOut, Palette, PanelLeftClose, PanelLeftOpen, Settings, } from "lucide-react";
|
|
5
5
|
import { Button } from "../../shadcn/button";
|
|
6
6
|
import { cn } from "../../utils/cn";
|
|
7
7
|
import { useSidebar } from "../../shadcn/sidebar";
|
|
@@ -16,7 +16,10 @@ 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/",
|
|
21
|
+
// baseUrl = "https://api.nexicron.com",
|
|
22
|
+
}) => {
|
|
20
23
|
const [user, setUser] = React.useState();
|
|
21
24
|
const [accounts, setAccounts] = React.useState([]);
|
|
22
25
|
const [selectedAccount, setSelectedAccount] = React.useState();
|
|
@@ -125,7 +128,11 @@ export const MainSidebar = ({ baseUrl, platformUrl, releaseOpsUrl = "https://iko
|
|
|
125
128
|
var _a, _b;
|
|
126
129
|
const hasIcon = Boolean(software.icon && software.icon.trim() !== "");
|
|
127
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));
|
|
128
|
-
}) }), ((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
|
+
}) }), ((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: [
|
|
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 },
|
|
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 () => {
|
|
129
136
|
await clearAllCookieSession();
|
|
130
137
|
redirect(`${platformUrl}/login.html`);
|
|
131
138
|
}, className: "flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive", children: [_jsx(LogOut, { className: "h-4 w-4 text-foreground" }), _jsx("span", { children: "Log out" })] })] })] }), _jsx("div", { className: cn("mb-2 flex", expanded ? "justify-end" : "justify-center"), children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: expanded ? "default" : "icon", className: cn("h-8", expanded ? "w-full justify-start gap-3 px-3" : "w-8"), onClick: () => {
|