<script setup>
import { Primitive } from "reka-ui";
import { cn } from "../../../utils/cn";
const props = defineProps({
  asChild: { type: Boolean, required: false },
  as: { type: null, required: false, default: "button" },
  showOnHover: { type: Boolean, required: false },
  class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true }
});
</script>

<template>
  <Primitive
    data-slot="sidebar-menu-action"
    data-sidebar="menu-action"
    :class="cn(
  'text-zinc-500 absolute top-1/2 right-0.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform [&>svg]:size-4 [&>svg]:shrink-0 cursor-pointer',
  'after:absolute after:-inset-2 md:after:hidden',
  'peer-data-[size=sm]/menu-button:top-1',
  'peer-data-[size=default]/menu-button:top-1.5',
  'peer-data-[size=lg]/menu-button:top-2.5',
  'group-data-[collapsible=icon]:hidden',
  showOnHover && 'peer-data-[active=true]/menu-button:text-zinc-900 group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
  props.class
)"
    :as="as"
    :as-child="asChild"
  >
    <slot />
  </Primitive>
</template>
