// Ported from legacy henza_pwa/src/store/navStore.ts (a hand-rolled reactive // class) to a real Pinia store, preserving the same state shape and setter // behavior. The route list itself was redesigned to a 5-tab bottom nav // (Home, Search, Cart, Orders, Profile) — see components/ui/Navigation.vue. import { defineStore } from 'pinia' interface NavItem { name: string path: string icon: string label: string index: number } interface NavState { navBarRoutes: NavItem[] activeLink: number showNav: boolean // legacy passes `undefined` to clear the transition (router/index.ts:270) pageTransition: string | undefined } export const useNavStore = defineStore('nav', { state: (): NavState => ({ navBarRoutes: [ { name: 'home', path: '/home', icon: 'vuesax-linear:home-2', label: 'خانه', index: 1 }, { name: 'search', path: '/search', icon: 'vuesax-linear:search-normal-1', label: 'جستجو', index: 2 }, { name: 'cart', path: '/cart', icon: 'vuesax-linear:bag-happy', label: 'سبد خرید', index: 3 }, { name: 'ordersList', path: '/orders', icon: 'vuesax-linear:receipt-text', label: 'سفارشات', index: 4 }, { name: 'userPage::hasSubRoute', path: '/user', icon: 'vuesax-linear:user', label: 'پروفایل', index: 5 }, ], activeLink: 1, showNav: true, pageTransition: 'right', }), actions: { setNavVisibility(data: boolean) { this.showNav = data }, setActiveLink(activeLink: number) { this.activeLink = activeLink }, setPgaTransition(transition: string | undefined) { this.pageTransition = transition }, }, })