Line data Source code
1 : <template>
2 1 : <BaseWorkflowsSidebarTab
3 : :title="$t('linearMode.appModeToolbar.apps')"
4 : :filter="isAppWorkflow"
5 : hide-leaf-icon
6 : :search-subject="$t('linearMode.appModeToolbar.apps')"
7 : data-testid="apps-sidebar"
8 : >
9 : <template #alt-title>
10 : <Badge variant="pill" severity="default" class="ml-2 px-1.5 uppercase">
11 : {{ $t('g.beta') }}
12 : </Badge>
13 : </template>
14 : <template #header-actions="{ hasResults }">
15 : <Button
16 : v-if="hasResults"
17 : variant="secondary"
18 : size="md"
19 : @click="createApp"
20 : >
21 : <i class="icon-[lucide--plus]" aria-hidden="true" />
22 : {{ $t('linearMode.appModeToolbar.create') }}
23 : </Button>
24 : </template>
25 : <template #empty-state>
26 : <NoResultsPlaceholder
27 : button-variant="secondary"
28 : text-class="text-muted-foreground text-sm"
29 : :message="`${$t('linearMode.appModeToolbar.appsEmptyMessage')}\n${$t('linearMode.appModeToolbar.appsEmptyMessageAction')}`"
30 : button-icon="icon-[lucide--plus]"
31 : :button-label="$t('linearMode.appModeToolbar.createApp')"
32 : @action="createApp"
33 : />
34 : </template>
35 : </BaseWorkflowsSidebarTab>
36 : </template>
37 :
38 : <script setup lang="ts">
39 : import Badge from '@comfyorg/design-system/badge/Badge'
40 : import NoResultsPlaceholder from '@comfyorg/design-system/common/NoResultsPlaceholder'
41 : import BaseWorkflowsSidebarTab from '@/components/sidebar/tabs/BaseWorkflowsSidebarTab.vue'
42 : import Button from '@comfyorg/design-system/button/Button'
43 : import type { ComfyWorkflow } from '@/platform/workflow/management/stores/workflowStore'
44 : import { useCommandStore } from '@/platform/keybindings/commandStore'
45 :
46 1 : const commandStore = useCommandStore()
47 :
48 0 : function isAppWorkflow(workflow: ComfyWorkflow): boolean {
49 0 : return workflow.suffix === 'app.json'
50 : }
51 :
52 0 : function createApp() {
53 0 : void commandStore.execute('Comfy.NewBlankWorkflow')
54 : }
55 : </script>
|