diff --git a/app/components/dashboard/project-management/digital-innovation-page.tsx b/app/components/dashboard/project-management/digital-innovation-page.tsx index 9d3d3d7..dab091f 100644 --- a/app/components/dashboard/project-management/digital-innovation-page.tsx +++ b/app/components/dashboard/project-management/digital-innovation-page.tsx @@ -12,7 +12,6 @@ import { Zap, } from "lucide-react"; import moment from "moment-jalaali"; -import { formatNumber } from "~/lib/utils"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import toast from "react-hot-toast"; import { Badge } from "~/components/ui/badge"; @@ -35,7 +34,7 @@ import { TableRow, } from "~/components/ui/table"; import apiService from "~/lib/api"; -import { formatCurrency } from "~/lib/utils"; +import { formatCurrency, formatNumber } from "~/lib/utils"; import { DashboardLayout } from "../layout"; moment.loadPersian({ usePersianDigits: true }); @@ -370,7 +369,8 @@ export function DigitalInnovationPage() { const scrollContainer = scrollContainerRef.current; const handleScroll = () => { - if (!scrollContainer || !hasMore || loadingMore || fetchingRef.current) return; + if (!scrollContainer || !hasMore || loadingMore || fetchingRef.current) + return; // Clear previous timeout if (scrollTimeoutRef.current) { @@ -390,7 +390,9 @@ export function DigitalInnovationPage() { }; if (scrollContainer) { - scrollContainer.addEventListener("scroll", handleScroll, { passive: true }); + scrollContainer.addEventListener("scroll", handleScroll, { + passive: true, + }); } return () => { @@ -452,14 +454,12 @@ export function DigitalInnovationPage() { innovation_digital_function: {}, }); - - // let payload: DigitalInnovationMetrics = raw?.data; // console.log("*-*-*-*" +payload); // if (typeof payload === "string") { // try { // payload = JSON.parse(payload).innovation_digital_function; - + // } catch {} // } @@ -469,10 +469,10 @@ export function DigitalInnovationPage() { try { // مرحله اول: data رو از string به object تبدیل کن const parsedData = JSON.parse(raw.data); - + // مرحله دوم: innovation_digital_function رو که خودش string هست parse کن const arr = JSON.parse(parsedData.innovation_digital_function); - + // مرحله سوم: اولین خانه آرایه رو بردار if (Array.isArray(arr) && arr.length > 0) { payload = arr[0]; @@ -482,8 +482,6 @@ export function DigitalInnovationPage() { } } - - const parseNum = (v: unknown): number => { if (v == null) return 0; if (typeof v === "number") return v; @@ -601,7 +599,7 @@ export function DigitalInnovationPage() { variant="ghost" size="sm" onClick={() => handleProjectDetails(item)} - className="text-emerald-400 hover:text-emerald-300 hover:bg-emerald-500/20 p-2 h-auto cursor-pointer" + className="text-pr-green hover:text-emerald-300 underline-offset-4 underline font-normal hover:bg-emerald-500/20 p-2 h-auto" > جزئیات بیشتر @@ -955,7 +953,7 @@ export function DigitalInnovationPage() { شرح پروژه -
- {(card.value)} + {card.value}
{selectedProjectDetails?.project_description || "-"}
diff --git a/app/components/dashboard/sidebar.tsx b/app/components/dashboard/sidebar.tsx index ab0f8c1..6780184 100644 --- a/app/components/dashboard/sidebar.tsx +++ b/app/components/dashboard/sidebar.tsx @@ -1,25 +1,13 @@ import { - Box, - Building2, ChevronDown, - ChevronRight, - FolderKanban, GalleryVerticalEnd, - Globe, - LayoutDashboard, - Leaf, - Lightbulb, + House, + LightbulbIcon, + ListTodo, LogOut, - MonitorSmartphone, - Package, + Radar, Settings, Star, - Workflow, - DiscAlbum, - House, - ListTodo, - LightbulbIcon, - Radar } from "lucide-react"; import React, { useState } from "react"; import { Link, useLocation } from "react-router"; @@ -49,7 +37,6 @@ interface MenuItem { } const menuItems: MenuItem[] = [ - { id: "dashboard", label: "صفحه اصلی", @@ -123,7 +110,6 @@ const menuItems: MenuItem[] = [ icon: null, href: "#", // This is not a route, it opens a popup }, - ]; const bottomMenuItems: MenuItem[] = [ @@ -172,7 +158,10 @@ export function Sidebar({ // Update header title based on current route // If a child route is active, use that child's label prefixed by parent label let activeTitle: string | undefined = undefined; - let activeIcon: React.ComponentType<{ className?: string }> | null | undefined = undefined; + let activeIcon: + | React.ComponentType<{ className?: string }> + | null + | undefined = undefined; menuItems.forEach((item) => { if (item.children) { const activeChild = item.children.find( @@ -190,7 +179,10 @@ export function Sidebar({ } }); if (onTitleChange) { - onTitleChange({ title: activeTitle ?? "صفحه اول", icon: activeIcon ?? null }); + onTitleChange({ + title: activeTitle ?? "صفحه اول", + icon: activeIcon ?? null, + }); } }; @@ -261,7 +253,7 @@ export function Sidebar({