diff --git a/frontend/components/global/Header.vue b/frontend/components/global/Header.vue index faf40cc..af89243 100644 --- a/frontend/components/global/Header.vue +++ b/frontend/components/global/Header.vue @@ -3,50 +3,49 @@ import useGetAccount from "~/composables/api/account/useGetAccount"; import { useAuth } from "~/composables/api/auth/useAuth"; - -// types - -type NavLink = { - title: string; - path: string; -}; +import { useToast } from "~/composables/global/useToast"; +import { NAV_LINKS } from "~/constants"; // state -const { data: account } = useGetAccount(); const route = useRoute(); -const { logout } = useAuth(); +const router = useRouter(); -const nav_links = ref([ +const { addToast } = useToast(); +const { logout, token } = useAuth(); + +const profileDropdownItems = ref([ { - title: "خانه", - path: "/", + title: "ورود به پنل کاربری", + icon: "ci:profile", + onClick: () => router.push({ name: "profile" }), }, { - title: "محصولات", - path: "/products", - }, - { - title: "دسته بندی ها", - path: "/category", - }, - { - title: "ارتباط با ما", - path: "/contact-us", - }, - { - title: "امکانات", - path: "#", + title: "خروج از حساب", + icon: "bi:arrow-bar-left", + itemClass: "!text-red-500", + iconClass: "**:stroke-red-500 **:fill-transparent", + onClick: () => { + logout(); + nextTick(() => { + addToast({ + message: "با موفقیت از حساب خارج شدید", + options: { + status: "success", + }, + }); + }); + }, }, ]); +// queries + +const { data: account } = useGetAccount(); + // computed const isHomePage = computed(() => route.path === "/"); - -// lifecycle - -onMounted(() => {});