Line data Source code
1 : <script setup lang="ts">
2 : import WorkflowTemplateDownloadStatus from '@/platform/workflow/templates/components/WorkflowTemplateDownloadStatus.vue'
3 : import Badge from '@comfyorg/design-system/badge/Badge'
4 : import type { TemplateDetailRow } from '@/platform/workflow/templates/types/templateDetail'
5 :
6 : const { row } = defineProps<{ row: TemplateDetailRow }>()
7 2355 : const emit = defineEmits<{ download: [] }>()
8 0 : </script>
9 :
10 : <template>
11 : <a
12 0 : v-if="row.status?.kind === 'manual'"
13 : :href="row.status.href"
14 : target="_blank"
15 : rel="noopener noreferrer"
16 : class="col-start-3 row-start-1 shrink-0 text-xs text-foreground no-underline hover:underline focus-visible:rounded-sm focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none"
17 : >
18 : {{ row.status.label }}
19 : <span aria-hidden="true">↗</span>
20 : </a>
21 : <WorkflowTemplateDownloadStatus
22 : v-else-if="row.status?.kind === 'downloadable'"
23 : :status="row.status"
24 : :row-name="row.name"
25 : @download="emit('download')"
26 : />
27 : <span
28 : v-else-if="row.status?.kind === 'installed'"
29 : role="img"
30 : :aria-label="row.status.label"
31 : :title="row.status.label"
32 : class="col-start-3 row-start-1 flex size-8 shrink-0 items-center justify-center"
33 : >
34 : <i aria-hidden="true" class="icon-[lucide--circle-check] text-success" />
35 : </span>
36 : <span
37 : v-else-if="row.status"
38 : class="col-start-3 row-start-1 flex shrink-0 items-center gap-2"
39 : >
40 : <Badge severity="secondary" variant="compact" class="text-muted-foreground">
41 : {{ row.status.label }}
42 : </Badge>
43 : </span>
44 : </template>
|