mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 05:49:54 +00:00
* Add support for custom iconify using tailwind plugin - Register svgs from custom icons folder - Update existing custom icons to remove padding - Swap component icons for classes in sidebar tabs - Update browse templates in menu to use custom icon * Add basic check for custom SVG icons * Remove unused iconify packages
29 lines
942 B
TypeScript
29 lines
942 B
TypeScript
import { markRaw } from 'vue'
|
|
|
|
import ModelLibrarySidebarTab from '@/components/sidebar/tabs/ModelLibrarySidebarTab.vue'
|
|
import { useElectronDownloadStore } from '@/stores/electronDownloadStore'
|
|
import type { SidebarTabExtension } from '@/types/extensionTypes'
|
|
import { isElectron } from '@/utils/envUtil'
|
|
|
|
export const useModelLibrarySidebarTab = (): SidebarTabExtension => {
|
|
return {
|
|
id: 'model-library',
|
|
icon: 'icon-[comfy--ai-model]',
|
|
title: 'sideToolbar.modelLibrary',
|
|
tooltip: 'sideToolbar.modelLibrary',
|
|
label: 'sideToolbar.labels.models',
|
|
component: markRaw(ModelLibrarySidebarTab),
|
|
type: 'vue',
|
|
iconBadge: () => {
|
|
if (isElectron()) {
|
|
const electronDownloadStore = useElectronDownloadStore()
|
|
if (electronDownloadStore.inProgressDownloads.length > 0) {
|
|
return electronDownloadStore.inProgressDownloads.length.toString()
|
|
}
|
|
}
|
|
|
|
return null
|
|
}
|
|
}
|
|
}
|