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

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

export default {
    name: 'GalleryZoomIn',
    extends: BaseGalleryZoomIn,
    inheritAttrs: false,
    inject: ['$pcGallery'],
    methods: {
        onClick() {
            this.$pcGallery?.onClickAction('zoomIn');
        }
    },
    computed: {
        zoomed() {
            return this.$pcGallery?.activeItemTransform?.zoomed ?? false;
        }
    }
};
</script>
