fix(daily): opt

This commit is contained in:
zhangheng
2026-04-11 17:37:09 +08:00
parent 35b6849a64
commit 6baeae111e
6 changed files with 332 additions and 24 deletions

View File

@@ -1,14 +1,39 @@
// import { type LucideIcon } from "lucide-react";
import {
AuthMenuIcon,
PersonalMenuIcon,
SystemIcon,
TaskMenuIcon,
} from "./icons/custom"
IconCategory2,
IconCube3dSphere,
IconFileText,
IconFolder,
IconFolders,
IconHierarchy3,
IconLayoutDashboard,
IconPhoto,
IconSettings,
IconUserCircle,
IconUsersGroup,
IconVideo,
} from "@tabler/icons-react"
import React from "react"
const iconMap = {
DashboardIcon: IconLayoutDashboard,
EmployeeManagementIcon: IconUsersGroup,
ImageAnnotationIcon: IconPhoto,
LidarAnnotationIcon: IconCube3dSphere,
ManagementCenterIcon: IconSettings,
MyProjectsIcon: IconFolder,
PersonalCenterIcon: IconUserCircle,
ProjectCategoryIcon: IconCategory2,
ProjectManagementIcon: IconFolders,
ReportIcon: IconFileText,
TeamManagementIcon: IconHierarchy3,
VideoAnnotationIcon: IconVideo,
SystemIcon: IconSettings,
PersonalMenuIcon: IconUserCircle,
TaskMenuIcon: IconLayoutDashboard,
AuthMenuIcon: IconFileText,
} as const
export const ClientIcon = React.forwardRef<
HTMLDivElement,
React.ComponentProps<"button"> & {
@@ -16,12 +41,7 @@ export const ClientIcon = React.forwardRef<
}
>(({ icon, ...props }, _ref) => {
if (icon) {
const IconComponent = {
SystemIcon,
PersonalMenuIcon,
TaskMenuIcon,
AuthMenuIcon,
}[icon]
const IconComponent = iconMap[icon as keyof typeof iconMap]
return IconComponent ? <IconComponent style={{ ...props.style }} /> : null
} else {
return null