<script setup lang="ts">
import type { WithClassAsProps } from "./interface"
import { cn } from "@/lib/utils"
import { useCarousel } from "./useCarousel"
import ArrowIcon from '@/pages/Home/modules4/arrow.svg?component'

const props = defineProps<WithClassAsProps>()

const { orientation, canScrollNext, scrollNext } = useCarousel()
</script>

<template>
  <button
    data-slot="carousel-next"
    :class="cn(
      'absolute cursor-pointer z-10',
      orientation === 'horizontal'
        ? 'top-1/2 -right-12 -translate-y-1/2'
        : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
      props.class,
    )"
    @click="scrollNext"
  >
    <slot>
      <ArrowIcon class="h-[120px] w-auto rotate-180" />
      <span class="sr-only">Next Slide</span>
    </slot>
  </button>
</template>
