"use client" import { useIntl } from "react-intl" import { Divider } from "@scandic-hotels/design-system/Divider" import Link from "@scandic-hotels/design-system/Link" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" import Title from "@scandic-hotels/design-system/Title" import { logout } from "@/constants/routes/handleAuth" import useDropdownStore from "@/stores/main-menu" import { useMyPagesNavigation } from "@/components/Header/MainMenu/MyPagesMenuContent" import useLang from "@/hooks/useLang" import styles from "./my-pages-mobile-dropdown.module.css" import type { ReactNode } from "react" import { DropdownTypeEnum } from "@/types/components/dropdown/dropdown" export default function MyPagesMobileDropdown() { const intl = useIntl() const { toggleDropdown, isMyPagesMobileMenuOpen } = useDropdownStore() const handleOnClick = () => toggleDropdown(DropdownTypeEnum.MyPagesMobileMenu) return ( ) } function List({ children }: { children: ReactNode }) { return ( <>
) } function PrimaryLinks({ handleOnClick }: { handleOnClick: () => void }) { const { data: myPagesNavigation, isLoading, isSuccess, } = useMyPagesNavigation() const primaryLinks = myPagesNavigation?.primaryLinks ?? [] return ( <> {isLoading && } {isSuccess && primaryLinks.map((link, i) => (
  • {link.text}
  • ))} ) } function SecondaryLinks({ handleOnClick }: { handleOnClick: () => void }) { const { data: myPagesNavigation, isLoading, isSuccess, } = useMyPagesNavigation() const secondaryLinks = myPagesNavigation?.secondaryLinks ?? [] const intl = useIntl() const lang = useLang() return ( <> {isLoading && } {isSuccess && secondaryLinks.map((link, i) => (
  • {link.text}
  • ))}
  • {intl.formatMessage({ defaultMessage: "Log out", })}
  • ) } function Skeletons({ count }: { count: number }) { return ( <> {Array.from({ length: count }).map((_, i) => (
  • ))} ) }