Line data Source code
1 : import { computed, markRaw, reactive } from 'vue'
2 :
3 : import NodeLibrarySidebarTab from '@/components/sidebar/tabs/NodeLibrarySidebarTab.vue'
4 : import NodeLibrarySidebarTabV2 from '@/components/sidebar/tabs/NodeLibrarySidebarTabV2.vue'
5 : import { useSettingStore } from '@/platform/settings/settingStore'
6 : import type { SidebarTabExtension } from '@/types/extensionTypes'
7 :
8 2355 : export function useNodeLibrarySidebarTab(): SidebarTabExtension {
9 2355 : const settingStore = useSettingStore()
10 2355 : const component = computed(() =>
11 : settingStore.get('Comfy.NodeLibrary.NewDesign')
12 : ? markRaw(NodeLibrarySidebarTabV2)
13 : : markRaw(NodeLibrarySidebarTab)
14 : )
15 :
16 2355 : return reactive({
17 : id: 'node-library',
18 : icon: 'icon-[comfy--node]',
19 : title: 'sideToolbar.nodeLibrary',
20 : tooltip: 'sideToolbar.nodeLibrary',
21 : label: 'sideToolbar.labels.nodes',
22 : component,
23 : type: 'vue' as const
24 : })
25 : }
|