|
| 1 | +<script setup lang="ts"> |
| 2 | +import type { DevtoolsPluginInfo } from '../../types' |
| 3 | +import { computed, ref } from 'vue' |
| 4 | +
|
| 5 | +const props = defineProps<{ |
| 6 | + plugins: DevtoolsPluginInfo[] |
| 7 | +}>() |
| 8 | +
|
| 9 | +const showAll = ref(false) |
| 10 | +
|
| 11 | +const devtoolsCount = computed(() => props.plugins.filter(p => p.hasDevtools).length) |
| 12 | +
|
| 13 | +const filtered = computed(() => { |
| 14 | + if (showAll.value) |
| 15 | + return props.plugins |
| 16 | + return props.plugins.filter(p => p.hasDevtools) |
| 17 | +}) |
| 18 | +</script> |
| 19 | + |
| 20 | +<template> |
| 21 | + <div flex="~ col gap-3" p4> |
| 22 | + <div flex="~ items-center gap-3" text-xs> |
| 23 | + <span op60> |
| 24 | + {{ devtoolsCount }} devtools plugins / {{ plugins.length }} total |
| 25 | + </span> |
| 26 | + <label flex="~ items-center gap-1.5" op60 cursor-pointer select-none> |
| 27 | + <input v-model="showAll" type="checkbox"> |
| 28 | + Show all |
| 29 | + </label> |
| 30 | + </div> |
| 31 | + |
| 32 | + <table w-full text-sm> |
| 33 | + <thead> |
| 34 | + <tr border="b base" text-left> |
| 35 | + <th px2 py1 font-medium op60 text-xs> |
| 36 | + Plugin Name |
| 37 | + </th> |
| 38 | + <th px2 py1 font-medium op60 text-xs text-center> |
| 39 | + DevTools |
| 40 | + </th> |
| 41 | + <th px2 py1 font-medium op60 text-xs text-center> |
| 42 | + Setup |
| 43 | + </th> |
| 44 | + <th px2 py1 font-medium op60 text-xs> |
| 45 | + Capabilities |
| 46 | + </th> |
| 47 | + </tr> |
| 48 | + </thead> |
| 49 | + <tbody> |
| 50 | + <tr |
| 51 | + v-for="plugin in filtered" :key="plugin.name" |
| 52 | + border="b base" hover:bg-active |
| 53 | + :class="!plugin.hasDevtools ? 'op40' : ''" |
| 54 | + > |
| 55 | + <td px2 py1.5 font-mono text-xs> |
| 56 | + {{ plugin.name }} |
| 57 | + </td> |
| 58 | + <td px2 py1.5 text-center> |
| 59 | + <span v-if="plugin.hasDevtools" i-ph-check text-green /> |
| 60 | + <span v-else op20>-</span> |
| 61 | + </td> |
| 62 | + <td px2 py1.5 text-center> |
| 63 | + <span v-if="plugin.hasSetup" i-ph-check text-green /> |
| 64 | + <span v-else op20>-</span> |
| 65 | + </td> |
| 66 | + <td px2 py1.5 flex="~ items-center gap-1"> |
| 67 | + <template v-if="plugin.capabilities"> |
| 68 | + <DisplayBadge v-if="plugin.capabilities.dev" text="dev" /> |
| 69 | + <DisplayBadge v-if="plugin.capabilities.build" text="build" /> |
| 70 | + </template> |
| 71 | + <span v-else op20>-</span> |
| 72 | + </td> |
| 73 | + </tr> |
| 74 | + </tbody> |
| 75 | + </table> |
| 76 | + </div> |
| 77 | +</template> |
0 commit comments