import React, { Suspense } from 'react'; import { Routes, Route, Link, useLocation } from 'react-router-dom'; import { useAppStore } from './store/appStore'; // 页面组件 const Dashboard = React.lazy(() => import('./pages/Dashboard')); const ComponentShowcase = React.lazy(() => import('./pages/ComponentShowcase')); const InteractiveDemo = React.lazy(() => import('./pages/InteractiveDemo')); const ConfigurationGuide = React.lazy(() => import('./pages/ConfigurationGuide')); // 通用组件 const LoadingSpinner: React.FC = () => (
); const Navigation: React.FC = () => { const location = useLocation(); const { theme, toggleTheme } = useAppStore(); const navItems = [ { path: '/', label: 'Dashboard', icon: '🏠' }, { path: '/showcase', label: 'Component Showcase', icon: '🎨' }, { path: '/interactive', label: 'Interactive Demo', icon: '🎯' }, { path: '/config', label: 'Configuration', icon: '⚙️' } ]; return ( ); }; const App: React.FC = () => { const { isLoading, error } = useAppStore(); if (error) { return (

Application Error

{error}

); } return (
}> } /> } /> } /> } />
); }; export default App;