export default () => {
    const { t } = inject('service')
    const props = reactive({ iconPos: "right", severity: "secondary", text: true });
    return reactive({
        getBind: (item) => Object.assign(item.props, props),
        menu: [
            {
                url: "/panel/profile",
                props: {
                    label: "پروفایل کاربری", icon: "isax isax-user-square -mt-1.5",
                },
            },
            {
                url: "/panel/favorites",
                props: { label: "علاقه مندی ها", icon: "isax isax-heart" },
            },
            {
                url: "/panel/comments",
                props: { label: "نظرات من", icon: "isax isax-message-text4" },
            },
            {
                url: "/panel/factors",
                props: { label: "فاکتورها", icon: "isax isax-receipt-2-1" },
            },
            {
                url: "/panel/moeen",
                props: { label: "فاکتور معین", icon: "isax isax-archive-book4" },
            },
            {
                url: "/panel/notification",
                props: { label: "اعلان ها", icon: "isax isax-notification" },
            },
            {
                url: "/panel/orders",
                props: { label: "سفارشات", icon: "isax isax-shopping-cart" },
            },
            {
                url: "/panel/seller/store",
                props: { label: "پنل فروشنده", icon: "isax isax-element-2" },
            },
        ],
        logoutBtn: {
            props: {
                label: t('logout'),
                icon: "isax isax-logout-1",
                iconPos: "right",
                severity: "secondary",
                text: true,
            }
        },
        floating: (menu, selector, index) => {
            const list = selector.value.previousSibling;
            const li = list.children[index];
            selector.value.style.width = li.offsetWidth + "px";
            const right =
                list.parentElement.offsetWidth - li.offsetLeft - li.offsetWidth;
            selector.value.style.right = right + "px";
            menu.forEach((item) => delete item.props.active);
            menu[index].props.active = true;
        }
    })

}