<script setup lang="ts">
import type { AccordionRootEmits, AccordionRootProps } from "reka-ui"
import type { HTMLAttributes } from "vue"
import { reactiveOmit } from "@vueuse/core"
import { AccordionRoot, useForwardPropsEmits } from "reka-ui"
import { cn } from "@/lib/utils"

export interface AccordionProps extends AccordionRootProps {
  class?: HTMLAttributes["class"]
}

const props = defineProps<AccordionProps>()
const emits = defineEmits<AccordionRootEmits>()

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

<template>
  <AccordionRoot v-bind="forwarded" :class="cn(props.class)">
    <slot />
  </AccordionRoot>
</template>
