11<script lang="ts" setup>
22import type { WatchEvent } from ' nuxt/schema'
33import type { SlashCommand , SlashCommandOption } from ' ../../../types'
4+ import slashCommands from ' #build/discord/slashCommands'
45import { computed , ref , useFetch , useRuntimeConfig , watchEffect } from ' #imports'
56import { useWebSocket } from ' @vueuse/core'
67import TheHeader from ' ../components/TheHeader.vue'
@@ -81,7 +82,7 @@ function getRemoteId(command: any): string | undefined {
8182 return undefined
8283}
8384
84- const commands = ref ([] as typeof import ( ' discord/ slashCommands' ). default )
85+ const commands = ref (slashCommands )
8586
8687const {
8788 data : diff,
@@ -90,9 +91,6 @@ const {
9091 ' /api/discord/slash-command/remote-diff' ,
9192 {
9293 method: ' post' ,
93- body: {
94- commands ,
95- },
9694 immediate: import .meta .dev ,
9795 },
9896)
@@ -301,9 +299,9 @@ const statusClasses = {
301299 >
302300 <template #header >
303301 <div class =" flex items-center justify-between" >
304- <div class =" flex gap-3 items-center " >
305- <UIcon name =" i-heroicons-command-line" class =" text-primary-500 h-5 w-5 " />
306- <div >
302+ <div class =" flex gap-3 items-start " >
303+ <UIcon name =" i-heroicons-command-line" class =" text-primary-500 my-0.75 size-6 " />
304+ <div class = " flex flex-col gap-1 items-start " >
307305 <h3
308306 class =" text-lg text-gray-700 font-semibold dark:text-gray-200"
309307 :class =" command.status === 'conflict' && 'text-[var(--ui-error)]!'"
@@ -314,7 +312,14 @@ const statusClasses = {
314312 {{ command.description }}
315313 </p >
316314 <UBadge
317- v-if =" command.options.length > 0"
315+ v-if =" 'subcommands' in command && (command.subcommands?.length ?? 0) > 0"
316+ :label =" `${command.subcommands!.length} subcommand${command.subcommands!.length === 1 ? '' : 's'}`"
317+ variant =" soft"
318+ color =" info"
319+ size =" sm"
320+ />
321+ <UBadge
322+ v-else-if =" command.options.length > 0"
318323 :label =" `${command.options.length} option${command.options.length === 1 ? '' : 's'}`"
319324 variant =" soft"
320325 color =" neutral"
0 commit comments