Blame view

美国版/Food Labeling Management Platform/src/App.tsx 1.95 KB
884054fb   “wangming”   项目初始化
1
  import { useState } from 'react';
3d4c10ac   杨鑫   对接,标签产品
2
  import { Toaster } from 'sonner';
884054fb   “wangming”   项目初始化
3
4
5
6
7
8
9
10
11
12
13
  import { Layout } from './components/layout/Layout';
  import { Dashboard } from './components/dashboard/Dashboard';
  import { PlaceholderView } from './components/PlaceholderView';
  
  import { LabelsView } from './components/labels/LabelsView';
  import { TrainingView } from './components/training/TrainingView';
  import { AlertsView } from './components/alerts/AlertsView';
  import { ProductsView } from './components/products/ProductsView';
  import { PeopleView } from './components/people/PeopleView';
  import { ReportsView } from './components/reports/ReportsView';
  import { LocationsView } from './components/locations/LocationsView';
de8956f8   杨鑫   平台端 门店,菜单,角色
14
  import { SystemMenuView } from './components/system-menu/SystemMenuView';
884054fb   “wangming”   项目初始化
15
16
17
18
19
20
21
22
23
24
25
26
  
  export default function App() {
    const [currentView, setCurrentView] = useState('Dashboard');
  
    const renderView = () => {
      switch (currentView) {
        case 'Dashboard':
          return <Dashboard />;
        case 'Training':
          return <TrainingView />;
        case 'Alerts':
          return <AlertsView />;
de8956f8   杨鑫   平台端 门店,菜单,角色
27
28
        case 'Menu Management':
          // 还原:Menu Management 对应“商品管理/新增”页面
884054fb   “wangming”   项目初始化
29
          return <ProductsView />;
de8956f8   杨鑫   平台端 门店,菜单,角色
30
31
        case 'System Menu':
          return <SystemMenuView />;
884054fb   “wangming”   项目初始化
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        case 'Account Management':
          return <PeopleView />;
        case 'Reports':
          return <ReportsView />;
        case 'Location Manager':
          return <LocationsView />;
        case 'Labels':
        case 'Label Categories':
        case 'Label Types':
        case 'Label Templates':
        case 'Multiple Options':
          return <LabelsView currentView={currentView} onViewChange={setCurrentView} />;
        default:
          return <PlaceholderView title={currentView} />;
      }
    };
  
    return (
3d4c10ac   杨鑫   对接,标签产品
50
51
52
53
54
55
      <>
        <Layout currentView={currentView} setCurrentView={setCurrentView}>
          {renderView()}
        </Layout>
        <Toaster position="top-center" richColors closeButton expand={false} />
      </>
884054fb   “wangming”   项目初始化
56
57
    );
  }