File size: 1,286 Bytes
4d70170 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
<script lang="ts">
import { computed, defineComponent } from 'vue'
import { useRouter } from 'vue-router'
import { usePlugins } from '.'
export default defineComponent({
props: {
pluginId: {
type: String,
required: true,
},
},
setup(props) {
const {
plugins,
} = usePlugins()
const plugin = computed(() => plugins.value.find(p => p.id === props.pluginId))
const router = useRouter()
function go() {
router.push({
name: 'plugin-details',
params: {
pluginId: props.pluginId,
},
})
}
return {
plugin,
go,
}
},
})
</script>
<template>
<div
v-if="plugin"
class="flex space-x-3 items-center"
>
<div class="flex items-center justify-center w-8 h-8 bg-gray-700 dark:bg-gray-200 rounded">
<img
v-if="plugin.logo"
:src="plugin.logo"
alt="Plugin logo"
class="max-w-[24px] max-h-[24px]"
>
<VueIcon
v-else
icon="extension"
/>
</div>
<div>
<div>Provided by <b>{{ plugin ? plugin.label : pluginId }}</b></div>
<div
v-if="plugin"
class="opacity-50"
>
<div>Plugin ID: {{ plugin.id }}</div>
</div>
</div>
</div>
</template>
|