import React, { ReactNode } from 'react' import { View } from '@tarojs/components' import { TabBar, TabBarItem } from '@/components/ui/tab-bar' import { useRouter } from '@tarojs/taro' export interface TabBarLayoutProps { children: ReactNode activeKey: string } const tabBarItems: TabBarItem[] = [ { key: 'home', title: 'ι¦–ι‘΅', icon: '🏠', selectedIcon: '🏠', }, { key: 'explore', title: 'ε‘ηŽ°', icon: 'πŸ”', selectedIcon: 'πŸ”', }, { key: 'profile', title: 'ζˆ‘ηš„', icon: 'πŸ‘€', selectedIcon: 'πŸ‘€', }, ] export const TabBarLayout: React.FC = ({ children, activeKey }) => { const handleTabChange = (key: string) => { // 使用 Taro ηš„ε―Όθˆͺ API θΏ›θ‘Œι‘΅ι’θ·³θ½¬ import('@tarojs/taro').then(({ default: Taro }) => { switch (key) { case 'home': Taro.switchTab({ url: '/pages/index/index' }) break case 'explore': Taro.switchTab({ url: '/pages/explore/index' }) break case 'profile': Taro.switchTab({ url: '/pages/profile/index' }) break default: break } }) } return ( {children} ) } export default TabBarLayout