<script setup lang="ts">
import type { PrimitiveProps } from 'reka-ui';
import type { SidebarMenuButtonVariants } from '.';
import { Primitive } from 'reka-ui';
import { cn } from '@/lib/utils';
import { sidebarMenuButtonVariants } from '.';

defineOptions({ inheritAttrs: false });

export interface SidebarMenuButtonProps extends PrimitiveProps {
  variant?: SidebarMenuButtonVariants['variant'];
  size?: SidebarMenuButtonVariants['size'];
  isActive?: boolean;
}

withDefaults(defineProps<SidebarMenuButtonProps>(), {
  as: 'button',
  variant: 'default',
  size: 'default',
});
</script>

<template>
  <Primitive
    v-bind="$attrs"
    data-slot="sidebar-menu-button"
    data-sidebar="menu-button"
    :data-size="size"
    :data-active="isActive"
    :class="
      cn(sidebarMenuButtonVariants({ variant, size }), $attrs.class ?? '')
    "
    :as="as"
    :as-child="asChild"
  >
    <slot />
  </Primitive>
</template>
