| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- import React from 'react';
- import { SidebarRail, NavItem } from './SidebarRail';
- import { MessageSquare, Book } from 'lucide-react';
- import { useLanguage } from '../../contexts/LanguageContext';
- interface WorkspaceLayoutProps {
- children: React.ReactNode;
- currentView: string;
- onViewChange: (view: string) => void;
- onLogout: () => void;
- currentUser: any;
- appMode?: 'workspace' | 'admin';
- onSwitchMode?: () => void;
- }
- export const WorkspaceLayout: React.FC<WorkspaceLayoutProps> = ({
- children, currentView, onViewChange, onLogout, currentUser, appMode, onSwitchMode
- }) => {
- const { t } = useLanguage();
- const navItems: NavItem[] = [
- { id: 'chat', icon: MessageSquare, label: t('navChat') },
- { id: 'notebooks', icon: Book, label: t('navKnowledgeGroups') },
- ];
- return (
- <div className='flex h-screen w-full bg-slate-50 overflow-hidden relative'>
- <SidebarRail
- currentView={currentView}
- onViewChange={onViewChange}
- onLogout={onLogout}
- currentUser={currentUser}
- navItems={navItems}
- appMode={appMode}
- onSwitchMode={onSwitchMode}
- />
- <div className="flex-1 overflow-hidden relative">
- {children}
- </div>
- </div>
- );
- };
|