Public Access
feat: enhance exam loading functionality with examId support and update UI components
This commit is contained in:
1 parent
50efba6f34
commit
2b7939d478
5 files changed
+41
-5
No files matched your search
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user