WorkspaceLayout.tsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import { SidebarRail, NavItem } from './SidebarRail';
  3. import { MessageSquare, Book } from 'lucide-react';
  4. import { useLanguage } from '../../contexts/LanguageContext';
  5. interface WorkspaceLayoutProps {
  6. children: React.ReactNode;
  7. currentView: string;
  8. onViewChange: (view: string) => void;
  9. onLogout: () => void;
  10. currentUser: any;
  11. appMode?: 'workspace' | 'admin';
  12. onSwitchMode?: () => void;
  13. }
  14. export const WorkspaceLayout: React.FC<WorkspaceLayoutProps> = ({
  15. children, currentView, onViewChange, onLogout, currentUser, appMode, onSwitchMode
  16. }) => {
  17. const { t } = useLanguage();
  18. const navItems: NavItem[] = [
  19. { id: 'chat', icon: MessageSquare, label: t('navChat') },
  20. { id: 'notebooks', icon: Book, label: t('navKnowledgeGroups') },
  21. ];
  22. return (
  23. <div className='flex h-screen w-full bg-slate-50 overflow-hidden relative'>
  24. <SidebarRail
  25. currentView={currentView}
  26. onViewChange={onViewChange}
  27. onLogout={onLogout}
  28. currentUser={currentUser}
  29. navItems={navItems}
  30. appMode={appMode}
  31. onSwitchMode={onSwitchMode}
  32. />
  33. <div className="flex-1 overflow-hidden relative">
  34. {children}
  35. </div>
  36. </div>
  37. );
  38. };