<script setup lang="ts">
import type { PrimitiveProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import type { BadgeVariants } from "."
import { reactiveOmit } from "@vueuse/core"
import { Primitive } from "reka-ui"
import { cn } from "@/lib/utils"
import { badgeVariants } from "."

const props = withDefaults(defineProps<PrimitiveProps & {
    variant?: BadgeVariants["variant"]
    size?: BadgeVariants["size"]
    class?: HTMLAttributes["class"]
}>(), {
    size: "default"
});

const delegatedProps = reactiveOmit(props, "class")
</script>

<template>
    <Primitive data-slot="badge" :class="cn(badgeVariants({ variant, size }), props.class)" v-bind="delegatedProps">
        <slot />
    </Primitive>
</template>
