Line data Source code
1 : <template>
2 0 : <GettingStartedCard
3 : :image-src="thumbnailSrc"
4 : :title
5 : :loading
6 : :failed
7 : :is-video="isVideo"
8 : :testid="`getting-started-card-${template.name}`"
9 : @select="emit('select', template.name)"
10 : />
11 : </template>
12 :
13 : <script setup lang="ts">
14 : import { computed } from 'vue'
15 :
16 : import { useTemplateWorkflows } from '@/platform/workflow/templates/composables/useTemplateWorkflows'
17 : import type { TemplateInfo } from '@comfyorg/api-client/templateTypes'
18 :
19 : import GettingStartedCard from './GettingStartedCard.vue'
20 :
21 : const { template } = defineProps<{
22 : template: TemplateInfo
23 : loading?: boolean
24 : failed?: boolean
25 : }>()
26 :
27 0 : const emit = defineEmits<{ select: [id: string] }>()
28 :
29 0 : const { getTemplateThumbnailUrl, getTemplateTitle } = useTemplateWorkflows()
30 :
31 0 : const thumbnailSrc = computed(() =>
32 : getTemplateThumbnailUrl(template, 'default')
33 : )
34 0 : const title = computed(() => getTemplateTitle(template, 'default'))
35 0 : const isVideo = computed(
36 : () => template.mediaType === 'video' || template.mediaSubtype === 'webp'
37 : )
38 : </script>
|