style(web): refactor dashboard icons to lucide-react for consistency

This commit is contained in:
dyzulk
2026-01-09 22:32:41 +07:00
parent 5958b93f84
commit b883715c26
7 changed files with 64 additions and 61 deletions

View File

@@ -8,21 +8,22 @@ import { useSidebar } from "../context/SidebarContext";
import useSWR from "swr";
import axios from "@/lib/axios";
import {
BoxCubeIcon,
CalenderIcon,
ChevronDownIcon,
GridIcon,
HorizontaLDots,
ListIcon,
PageIcon,
PieChartIcon,
PlugInIcon,
TableIcon,
UserCircleIcon,
LockIcon,
MailIcon,
PaperPlaneIcon,
} from "../icons/index";
LayoutGrid,
Calendar,
Users,
ShieldCheck,
LifeBuoy,
FileText,
Send,
Mail,
Server,
Layers,
UserCircle,
Settings,
KeyRound,
ChevronDown,
Ellipsis,
} from "lucide-react";
type NavItem = {
name: string;
@@ -37,23 +38,23 @@ type MenuGroup = {
};
const iconMap: Record<string, React.ReactNode> = {
dashboard: <GridIcon />,
calendar: <CalenderIcon />,
users: <UserCircleIcon />,
certificate: <BoxCubeIcon />,
"support-ticket": <PlugInIcon />,
pages: <PageIcon />,
email: <PaperPlaneIcon />,
inbox: <MailIcon />,
smtp: <PaperPlaneIcon />,
"server-settings": <BoxCubeIcon />,
layers: <BoxCubeIcon />,
"user-profile": <UserCircleIcon />,
settings: <BoxCubeIcon />,
"api-key": <LockIcon />,
dashboard: <LayoutGrid size={20} />,
calendar: <Calendar size={20} />,
users: <Users size={20} />,
certificate: <ShieldCheck size={20} />,
"support-ticket": <LifeBuoy size={20} />,
pages: <FileText size={20} />,
email: <Send size={20} />,
inbox: <Mail size={20} />,
smtp: <Send size={20} />,
"server-settings": <Server size={20} />,
layers: <Layers size={20} />,
"user-profile": <UserCircle size={20} />,
settings: <Settings size={20} />,
"api-key": <KeyRound size={20} />,
};
const getIcon = (iconName: string) => iconMap[iconName] || <BoxCubeIcon />;
const getIcon = (iconName: string) => iconMap[iconName] || <LayoutGrid size={20} />;
// Static items removed in favor of dynamic API data
@@ -101,7 +102,8 @@ const AppSidebar: React.FC = () => {
</span>
)}
{(isExpanded || isHovered || isMobileOpen) && (
<ChevronDownIcon
<ChevronDown
size={20}
className={`ml-auto w-5 h-5 transition-transform duration-200 ${
openSubmenu?.type === menuType &&
openSubmenu?.index === index
@@ -349,7 +351,7 @@ const AppSidebar: React.FC = () => {
try { return t(key); } catch { return group.title; }
})()
) : (
<HorizontaLDots />
<Ellipsis size={16} />
)}
</h2>
{renderMenuItems(group.items, group.title)}