33 lines
801 B
TypeScript
33 lines
801 B
TypeScript
import type { Component } from 'vue'
|
|
import {
|
|
Settings,
|
|
Globe,
|
|
ClipboardList,
|
|
Camera,
|
|
Activity,
|
|
Download,
|
|
Command
|
|
} from '@lucide/vue'
|
|
|
|
/**
|
|
* 模块图标映射表
|
|
*
|
|
* 模块配置中使用字符串标识(如 'proxy'),通过此表转换为实际图标组件。
|
|
* 新增模块时,在对应模块的 index.ts 中使用一致的 icon 字符串,
|
|
* 并在此处添加映射。
|
|
*/
|
|
export const moduleIconMap: Record<string, Component> = {
|
|
settings: Settings,
|
|
proxy: Globe,
|
|
clipboard: ClipboardList,
|
|
screenshot: Camera,
|
|
monitor: Activity,
|
|
downloader: Download,
|
|
quickpanel: Command
|
|
}
|
|
|
|
/** 获取模块图标组件,未找到时回退到 Settings 图标 */
|
|
export function getModuleIcon(iconName: string): Component {
|
|
return moduleIconMap[iconName] ?? Settings
|
|
}
|