feat: enhance exam loading functionality with examId support and update UI components
Test / backend (push) Successful in 14s
Test / frontend (push) Successful in 24s

This commit is contained in:
LaurensBartelds committed 2026-04-26 23:25:24 +02:00
1 parent 50efba6f34
commit 2b7939d478
5 files changed
+41 -5

No files matched your search

+7 -2
View File
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next'
import { useAuth } from '../contexts/AuthContext'
import * as examApi from '../api/examApi'
import * as resultApi from '../api/resultApi'
import type { Exam } from '../types'
import MyExams from './MyExams'
import MyResults from './MyResults'
import Settings from './Settings'
@@ -16,7 +17,11 @@ const TAB_KEYS: { key: TabKey; labelKey: string; icon: string }[] = [
{ key: 'settings', labelKey: 'workspace.settings', icon: '⚙' },
]
export default function Workspace() {
interface Props {
onLoadExam: (exam: Exam, saveToWorkspace?: boolean, examId?: number | null) => void
}
export default function Workspace({ onLoadExam }: Props) {
const { t } = useTranslation()
const { user, loading: authLoading } = useAuth()
const navigate = useNavigate()
@@ -77,7 +82,7 @@ export default function Workspace() {
</aside>
<main className="workspace-main">
{activeTab === 'exams' && <MyExams />}
{activeTab === 'exams' && <MyExams onLoadExam={onLoadExam} />}
{activeTab === 'results' && <MyResults />}
{activeTab === 'settings' && <Settings />}
</main>