<template>
  <label :for="label" class="o-checkbox">
    <input :type="isRadio ? 'radio' : 'checkbox'" :id="label" v-model="model" v-bind="$attrs" />
    <slot>{{ label }}</slot>
  </label>
</template>

<script setup lang="ts">
import { computed, defineEmits } from "vue";

const props = defineProps<{
  modelValue?: any,
  label: string,
  isRadio?: boolean,
  modifiers?: never;
}>();

const emit = defineEmits(["update:modelValue"]);
const model = computed({
  get: () => props.modelValue,
  set: (value) => emit("update:modelValue", value),
});

</script>