<template>
    <component v-if="!asChild" :is="as" :class="cx('root')" :type="as === 'BUTTON' ? 'button' : undefined" @click="onClick" v-bind="ptmi('root')">
        <slot />
    </component>
    <slot v-else :class="cx('root')" :onClick="onClick" />
</template>

<script>
import BaseGalleryNext from './BaseGalleryNext.vue';

export default {
    name: 'GalleryNext',
    extends: BaseGalleryNext,
    inheritAttrs: false,
    inject: ['$pcGallery'],
    methods: {
        onClick() {
            this.$pcGallery?.handleNext();
        }
    }
};
</script>
