update
This commit is contained in:
		
							
								
								
									
										70
									
								
								web/src/apps/muse/base/index.tsx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										70
									
								
								web/src/apps/muse/base/index.tsx
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,70 @@
 | 
			
		||||
import { useState } from "react";
 | 
			
		||||
import { Base } from "./table/index";
 | 
			
		||||
 | 
			
		||||
const tabs = [
 | 
			
		||||
  {
 | 
			
		||||
    key: 'table',
 | 
			
		||||
    title: '表格'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'graph',
 | 
			
		||||
    title: '关系图'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'world',
 | 
			
		||||
    title: '世界'
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
export const BaseApp = () => {
 | 
			
		||||
  const [activeTab, setActiveTab] = useState('table');
 | 
			
		||||
 | 
			
		||||
  const renderContent = () => {
 | 
			
		||||
    switch (activeTab) {
 | 
			
		||||
      case 'table':
 | 
			
		||||
        return <Base />;
 | 
			
		||||
      case 'graph':
 | 
			
		||||
        return (
 | 
			
		||||
          <div className="flex items-center justify-center h-96 text-gray-500">
 | 
			
		||||
            关系图模块暂未实现
 | 
			
		||||
          </div>
 | 
			
		||||
        );
 | 
			
		||||
      case 'world':
 | 
			
		||||
        return (
 | 
			
		||||
          <div className="flex items-center justify-center h-96 text-gray-500">
 | 
			
		||||
            世界模块暂未实现
 | 
			
		||||
          </div>
 | 
			
		||||
        );
 | 
			
		||||
      default:
 | 
			
		||||
        return null;
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <div className="w-full h-full">
 | 
			
		||||
      {/* Tab 导航栏 */}
 | 
			
		||||
      <div className="border-b border-gray-200">
 | 
			
		||||
        <nav className="flex space-x-8">
 | 
			
		||||
          {tabs.map((tab) => (
 | 
			
		||||
            <button
 | 
			
		||||
              key={tab.key}
 | 
			
		||||
              onClick={() => setActiveTab(tab.key)}
 | 
			
		||||
              className={`py-2 px-1 border-b-2 font-medium text-sm ${
 | 
			
		||||
                activeTab === tab.key
 | 
			
		||||
                  ? 'border-blue-500 text-blue-600'
 | 
			
		||||
                  : 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
 | 
			
		||||
              }`}
 | 
			
		||||
            >
 | 
			
		||||
              {tab.title}
 | 
			
		||||
            </button>
 | 
			
		||||
          ))}
 | 
			
		||||
        </nav>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      {/* Tab 内容区域 */}
 | 
			
		||||
      <div className="flex-1">
 | 
			
		||||
        {renderContent()}
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user