'use client'; import { Button } from 'antd'; import { useSelectedLayoutSegment, usePathname } from 'next/navigation'; import { Link } from '../../navigation'; import { AUTH_TOKEN_KEY, AUTH_USER } from '../../constants/common'; import { deleteStorageKey } from '../../hooks/useLocalStorage'; import { i18nText } from '../../i18nKeys'; import { getMenuConfig } from '../../utils/account'; export const AccountMenu = ({ locale }: { locale: string }) => { const selectedLayoutSegment = useSelectedLayoutSegment(); const pathname = selectedLayoutSegment || ''; const paths = usePathname(); const menu: { path: string, title: string, count?: number }[] = getMenuConfig(locale); const onLogout = () => { deleteStorageKey(AUTH_TOKEN_KEY); deleteStorageKey(AUTH_USER); window?.location?.replace(`/${paths.split('/')[1]}/`); }; return (