AdminLayout.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React from 'react';
  2. import { SidebarRail, NavItem } from './SidebarRail';
  3. import { Database } from 'lucide-react';
  4. import { useLanguage } from '../../contexts/LanguageContext';
  5. interface AdminLayoutProps {
  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 AdminLayout: React.FC<AdminLayoutProps> = ({
  15. children, currentView, onViewChange, onLogout, currentUser, appMode, onSwitchMode
  16. }) => {
  17. const { t } = useLanguage();
  18. const navItems: NavItem[] = [
  19. { id: 'knowledge', icon: Database, label: t('navKnowledge') }
  20. ];
  21. return (
  22. <div className='flex h-screen w-full bg-slate-50 overflow-hidden relative'>
  23. <SidebarRail
  24. currentView={currentView}
  25. onViewChange={onViewChange}
  26. onLogout={onLogout}
  27. currentUser={currentUser}
  28. navItems={navItems}
  29. appMode={appMode}
  30. onSwitchMode={onSwitchMode}
  31. />
  32. <div className="flex-1 overflow-hidden relative">
  33. {children}
  34. </div>
  35. </div>
  36. );
  37. };