mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-14 17:37:46 +00:00
36 lines
1.2 KiB
Vue
36 lines
1.2 KiB
Vue
<template>
|
|
<div
|
|
class="min-h-12 flex justify-between items-center px-4 py-2 text-xs text-muted font-medium leading-3"
|
|
>
|
|
<div v-if="nodePack.downloads" class="flex items-center gap-1.5">
|
|
<i class="pi pi-download text-muted"></i>
|
|
<span>{{ formattedDownloads }}</span>
|
|
</div>
|
|
<PackInstallButton v-if="!isInstalled" :node-packs="[nodePack]" />
|
|
<PackEnableToggle v-else :node-pack="nodePack" />
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
|
|
import PackEnableToggle from '@/components/dialog/content/manager/button/PackEnableToggle.vue'
|
|
import PackInstallButton from '@/components/dialog/content/manager/button/PackInstallButton.vue'
|
|
import { useComfyManagerStore } from '@/stores/comfyManagerStore'
|
|
import type { components } from '@/types/comfyRegistryTypes'
|
|
|
|
const { nodePack } = defineProps<{
|
|
nodePack: components['schemas']['Node']
|
|
}>()
|
|
|
|
const { isPackInstalled } = useComfyManagerStore()
|
|
const isInstalled = computed(() => isPackInstalled(nodePack?.id))
|
|
|
|
const { n } = useI18n()
|
|
|
|
const formattedDownloads = computed(() =>
|
|
nodePack.downloads ? n(nodePack.downloads) : ''
|
|
)
|
|
</script>
|