feat: implement QuestionBank CRUD with pagination and template query
- Add pagination support to findAll (page, limit query params) - Add findByTemplateId method to service - Add GET /by-template/:templateId endpoint to controller - Service already includes CRUD for QuestionBank and QuestionBankItem
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user