<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: "a" },
  size: { type: String, required: false, default: "md" },
  isActive: { type: Boolean, required: false },
  class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true }
});
</script>

<template>
  <Primitive
    data-slot="sidebar-menu-sub-button"
    data-sidebar="menu-sub-button"
    :as="as"
    :as-child="asChild"
    :data-size="size"
    :data-active="isActive"
    :class="cn(
  'text-zinc-700 cursor-pointer hover:bg-zinc-100 hover:text-zinc-900 active:bg-zinc-100 active:text-zinc-900 group-hover/menu-sub-item:bg-zinc-100 group-hover/menu-sub-item:text-zinc-900 group-focus-within/menu-sub-item:bg-zinc-100 group-focus-within/menu-sub-item:text-zinc-900 [&>svg]:text-zinc-900 flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0',
  'data-[active=true]:bg-[color-mix(in_srgb,var(--primary)_10%,white)] data-[active=true]:text-(--primary)',
  size === 'sm' && 'text-xs',
  size === 'md' && 'text-sm',
  'group-data-[collapsible=icon]:hidden',
  props.class
)"
  >
    <slot />
  </Primitive>
</template>
