<script setup lang="ts">
import { Checkbox } from "@/components/ui/checkbox"
import CommandItem from "./CommandItem.vue"

interface Props {
  value: string
  modelValue: boolean
}

const props = defineProps<Props>()
const emit = defineEmits<{
  "update:modelValue": [value: boolean]
}>()
</script>

<template>
  <CommandItem :value="value" @select="emit('update:modelValue', !modelValue)">
    <Checkbox
      :model-value="modelValue"
      tabindex="-1"
      class="mr-2 pointer-events-none"
    />
    <slot />
  </CommandItem>
</template>
