Line data Source code
1 : <template>
2 11006 : <ContextMenu :model="getTabContextMenu(tab)" @close-auto-focus.prevent>
3 : <SidebarIcon
4 : :icon="tab.icon"
5 : :icon-badge="tab.iconBadge"
6 : :provenance-badge="isAgentTab(tab) ? 'AI' : undefined"
7 : :provenance-label="isAgentTab(tab) ? t('g.agentCreated') : undefined"
8 : :tooltip="tab.tooltip"
9 : :tooltip-suffix
10 : :label="tab.label || tab.title"
11 : :is-small
12 : :selected
13 : :data-testid="`${tab.id}-tab-button`"
14 : @click="emit('click')"
15 : />
16 : </ContextMenu>
17 : </template>
18 :
19 : <script setup lang="ts">
20 : import { useI18n } from 'vue-i18n'
21 :
22 : import ContextMenu from '@comfyorg/design-system/menu/ContextMenu'
23 : import { useAgentSidebarTabs } from '@/composables/useAgentSidebarTabs'
24 : import type { AgentSidebarTab } from '@/composables/useAgentSidebarTabs'
25 :
26 : import SidebarIcon from './SidebarIcon.vue'
27 :
28 : defineProps<{
29 : tab: AgentSidebarTab
30 : tooltipSuffix: string
31 : isSmall: boolean
32 : selected: boolean
33 : }>()
34 :
35 10243 : const emit = defineEmits<{ (event: 'click'): void }>()
36 10243 : const { t } = useI18n()
37 10243 : const { getTabContextMenu, isAgentTab } = useAgentSidebarTabs()
38 : </script>
|