<script setup lang="ts">
import type { NavigationMenuIndicatorProps } from 'reka-ui';
import { NavigationMenuIndicator, useForwardProps } from 'reka-ui';
import { cn } from '@/lib/utils';

defineOptions({ inheritAttrs: false });

const props = defineProps<NavigationMenuIndicatorProps>();

const forwardedProps = useForwardProps(props);
</script>

<template>
  <NavigationMenuIndicator
    data-slot="navigation-menu-indicator"
    v-bind="{ ...forwardedProps, ...$attrs }"
    :class="
      cn(
        'data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden',
        $attrs.class ?? '',
      )
    "
  >
    <div
      class="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"
    />
  </NavigationMenuIndicator>
</template>
