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

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

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