You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
540 B
24 lines
540 B
<script setup lang="ts">
|
|
import { type HTMLAttributes, computed } from 'vue'
|
|
import { type BadgeVariants, badgeVariants } from '.'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface Props {
|
|
variant?: BadgeVariants['variant']
|
|
class?: HTMLAttributes['class']
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
const delegatedProps = computed(() => {
|
|
const { class: _, ...delegated } = props
|
|
|
|
return delegated
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div :class="cn(badgeVariants({ variant }), props.class)" v-bind="delegatedProps">
|
|
<slot />
|
|
</div>
|
|
</template>
|
|
|