import { FC } from 'react'; import { Link, Outlet, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { RiFileTextLine, RiFolderLine, RiUserLine, RiTeamLine, RiLogoutBoxRLine, RiSunLine, RiMoonLine, RiComputerLine, RiGlobalLine } from 'react-icons/ri'; import { useTheme } from '../../../hooks/useTheme'; import type { Theme } from '../../../hooks/useTheme'; interface AdminLayoutProps {} const menuItems = [ { path: '/admin/posts', icon: RiFileTextLine, label: 'admin.nav.posts' }, { path: '/admin/categories', icon: RiFolderLine, label: 'admin.nav.categories' }, { path: '/admin/users', icon: RiUserLine, label: 'admin.nav.users' }, { path: '/admin/contributors', icon: RiTeamLine, label: 'admin.nav.contributors' }, ]; const themeOptions = [ { value: 'light' as const, icon: RiSunLine, label: 'theme.light' }, { value: 'dark' as const, icon: RiMoonLine, label: 'theme.dark' }, { value: 'system' as const, icon: RiComputerLine, label: 'theme.system' } ]; const languageOptions = [ { value: 'en', label: 'English' }, { value: 'zh-Hans', label: '简体中文' }, { value: 'zh-Hant', label: '繁體中文' } ]; type LanguageMap = { 'en': 'zh-Hans'; 'zh-Hans': 'zh-Hant'; 'zh-Hant': 'en'; }; const languageMap: LanguageMap = { 'en': 'zh-Hans', 'zh-Hans': 'zh-Hant', 'zh-Hant': 'en' }; const AdminLayout: FC = () => { const location = useLocation(); const { t, i18n } = useTranslation(); const { theme, setTheme } = useTheme(); return (
{/* Background Overlay */}
{/* Sidebar */} {/* Main Content */}

{t(menuItems.find(item => item.path === location.pathname)?.label || 'admin.nav.dashboard')}

A
管理员
Administrator
); }; export default AdminLayout;