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

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

export default {
    name: 'SidebarMain',
    extends: BaseSidebarMain,
    inheritAttrs: false,
    inject: {
        $pcSidebarLayout: { default: null }
    },
    methods: {
        onClick(event) {
            this.$pcSidebarLayout?.onMainClick(event);
        }
    }
};
</script>
