File size: 1,144 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
<script lang="ts">
import { computed, defineComponent } from 'vue'
import { PluginPermission, hasPluginPermission } from '@vue-devtools/shared-utils'

export default defineComponent({
  props: {
    plugin: {
      type: Object,
      required: true,
    },
  },

  setup(props) {
    const enabled = computed(() => hasPluginPermission(props.plugin.id, PluginPermission.ENABLED))
    return {
      enabled,
    }
  },
})
</script>

<template>
  <router-link
    :to="{
      name: 'plugin-details',
      params: {
        pluginId: plugin.id,
      },
    }"
    class="flex items-center space-x-2 px-3 py-1 hover:bg-green-100 dark:hover:bg-green-800"
    :class="{
      'disabled opacity-50': !enabled,
    }"
    active-class="text-green-500 bg-green-50 dark:bg-green-900"
  >
    <VueIcon
      icon="extension"
    />

    <span>{{ plugin.label }}</span>

    <span
      v-if="!enabled"
      class="bg-gray-200 dark:bg-gray-800 text-gray-700 dark:text-gray-300 text-xs rounded px-1"
    >
      disabled
    </span>
  </router-link>
</template>

<style lang="postcss" scoped>
.vue-ui-icon :deep(svg) {
  fill: currentColor;
}
</style>