diff --git a/app/components/dashboard/header.tsx b/app/components/dashboard/header.tsx index 32c7fb0..16e955b 100644 --- a/app/components/dashboard/header.tsx +++ b/app/components/dashboard/header.tsx @@ -5,17 +5,16 @@ import { cn } from "~/lib/utils"; import { Button } from "~/components/ui/button"; import { PanelLeft, - Search, - Bell, + Settings, User, - Moon, - Sun, + Menu, ChevronDown, - Globe, - HelpCircle, + Server, + } from "lucide-react"; +import apiService from "~/lib/api"; interface HeaderProps { onToggleSidebar?: () => void; @@ -32,6 +31,18 @@ export function Header({ const [isProfileMenuOpen, setIsProfileMenuOpen] = useState(false); const [isNotificationOpen, setIsNotificationOpen] = useState(false); + const redirectHandler = async () => { + try { + const getData = await apiService.post('/GenerateSsoCode') + const url = `http://localhost:3000/redirect/${getData.data}`; + // const url = `https://inogen-bpms.pelekan.org/redirect/${getData.data}`; + + window.open(url, "_blank"); + } catch (error) { + console.log(error); + } + } + return (
تنظیمات + + )} diff --git a/app/components/dashboard/layout.tsx b/app/components/dashboard/layout.tsx index 0d12e7f..adcbb16 100644 --- a/app/components/dashboard/layout.tsx +++ b/app/components/dashboard/layout.tsx @@ -3,6 +3,7 @@ import { cn } from "~/lib/utils"; import { Sidebar } from "./sidebar"; import { Header } from "./header"; import { StrategicAlignmentPopup } from "./strategic-alignment-popup"; +import apiService from "~/lib/api"; interface DashboardLayoutProps { children: React.ReactNode; @@ -27,10 +28,12 @@ export function DashboardLayout({ setIsMobileSidebarOpen(!isMobileSidebarOpen); }; + + return (
{/* Gradient overlay */}
@@ -58,6 +61,7 @@ export function DashboardLayout({ onToggleCollapse={toggleSidebarCollapse} className="h-full flex-shrink-0 relative z-10" onStrategicAlignmentClick={() => setIsStrategicAlignmentPopupOpen(true)} + />
diff --git a/app/components/dashboard/sidebar.tsx b/app/components/dashboard/sidebar.tsx index 4a90072..8f23cbb 100644 --- a/app/components/dashboard/sidebar.tsx +++ b/app/components/dashboard/sidebar.tsx @@ -15,6 +15,7 @@ import { Settings, Star, Workflow, + DiscAlbum } from "lucide-react"; import React, { useState } from "react"; import { Link, useLocation } from "react-router"; @@ -38,7 +39,7 @@ interface MenuItem { } const menuItems: MenuItem[] = [ - + { id: "dashboard", label: "صفحه اصلی", @@ -106,12 +107,13 @@ const menuItems: MenuItem[] = [ icon: Star, href: "/dashboard/top-innovations", }, - { + { id: "strategic-alignment", label: "میزان انطباق راهبردی", icon: null, href: "#", // This is not a route, it opens a popup }, + ]; const bottomMenuItems: MenuItem[] = [ @@ -214,29 +216,29 @@ export function Sidebar({ } }; - if (item.id === "strategic-alignment") { -return ( - -) +
+ + ) - } + } return (
@@ -292,10 +294,10 @@ return ( "w-full text-right", // Disable pointer cursor when child is active (cannot collapse) item.children && - item.children.some( - (child) => child.href && location.pathname === child.href - ) && - "cursor-not-allowed" + item.children.some( + (child) => child.href && location.pathname === child.href + ) && + "cursor-not-allowed" )} onClick={handleClick} >