<script setup lang="ts">
import type { DropdownMenuTriggerProps } from "reka-ui"
import { DropdownMenuTrigger, useForwardProps } from "reka-ui"

const props = defineProps<DropdownMenuTriggerProps & {
    onTriggerClick?: (event: MouseEvent) => void
}>()

const forwardedProps = useForwardProps(props)

const handleClick = (event: MouseEvent) => {
    if (props.onTriggerClick) {
        props.onTriggerClick(event)
    }
}
</script>

<template>
    <DropdownMenuTrigger data-slot="dropdown-menu-trigger" v-bind="forwardedProps" @click="handleClick">
        <slot />
    </DropdownMenuTrigger>
</template>
