mirror of
https://github.com/jcreek/OpenNetworkDiagram.git
synced 2026-07-13 19:13:43 +00:00
feat(#5): add icon presets, dark mode theme store, and icon-aware graph rendering
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
export interface IconDefinition {
|
||||
key: string;
|
||||
label: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
const ICONS: IconDefinition[] = [
|
||||
{ key: 'server', label: 'Server', path: '/icons/server.svg' },
|
||||
{ key: 'router', label: 'Router', path: '/icons/router.svg' },
|
||||
{ key: 'switch', label: 'Switch', path: '/icons/switch.svg' },
|
||||
{ key: 'storage', label: 'Storage', path: '/icons/storage.svg' },
|
||||
{ key: 'desktop', label: 'Desktop', path: '/icons/desktop.svg' },
|
||||
{ key: 'cloud', label: 'Cloud', path: '/icons/cloud.svg' }
|
||||
];
|
||||
|
||||
const ICON_BY_KEY = new Map(ICONS.map((icon) => [icon.key, icon]));
|
||||
|
||||
export function listIconDefinitions(): IconDefinition[] {
|
||||
return ICONS;
|
||||
}
|
||||
|
||||
export function resolveIconPath(iconKey?: string): string | undefined {
|
||||
if (!iconKey) {
|
||||
return undefined;
|
||||
}
|
||||
return ICON_BY_KEY.get(iconKey)?.path;
|
||||
}
|
||||
Reference in New Issue
Block a user