- New examRepository (R2.1 seam): the only module talking to /api/exam (Supabase JWT → Bearer, axios to API_BASE). list/get/create/archive templates. - ExamDashboardPage (/exam-marker): lists institute templates, create dialog, archive; cards link to setup (S4-9). Wrapped in ErrorBoundary (R6.4). - exam.types.ts mirrors the API contract. - Dashboard 'Exam Marker' quick action (top-level discovery, R1.3/R6.1). Note: the in-canvas TeacherNavigation is unsuitable for a nav section (it's the worker prev/next tab bar) — flagged; used the dashboard entry instead. - R1.1 removal: deleted src/pages/tldraw/CCExamMarker/ (old 3-PDF viewer) and the now-dead CCExamMarkerPanel + its wiring in CCPanel/BasePanel (examMarkerProps was only ever passed by the deleted page). - Fixed pre-existing broken AppRoutes test (missing TimetableListPage mock export). Build green (vite); AppRoutes route tests pass; typecheck clean for new files. Co-Authored-By: Claude Opus 4.8 <[email protected]>
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import React, { useState } from 'react';
|
|
import { BasePanel } from './shared/BasePanel';
|
|
import { BaseContext, ViewContext } from '../../../../types/navigation';
|
|
|
|
interface CCPanelProps {
|
|
isExpanded?: boolean;
|
|
isPinned?: boolean;
|
|
onExpandedChange?: (expanded: boolean) => void;
|
|
onPinnedChange?: (pinned: boolean) => void;
|
|
}
|
|
|
|
export const CCPanel: React.FC<CCPanelProps> = ({
|
|
isExpanded,
|
|
isPinned,
|
|
onExpandedChange,
|
|
onPinnedChange,
|
|
}) => {
|
|
const [currentContext, setCurrentContext] = useState<BaseContext>('profile');
|
|
const [currentExtendedContext, setCurrentExtendedContext] = useState<ViewContext>('overview');
|
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
|
|
// Reset menu state when panel is closed
|
|
const handleExpandedChange = (expanded: boolean) => {
|
|
if (!expanded) {
|
|
setIsMenuOpen(false);
|
|
}
|
|
onExpandedChange?.(expanded);
|
|
};
|
|
|
|
return (
|
|
<BasePanel
|
|
isExpanded={isExpanded}
|
|
isPinned={isPinned}
|
|
onExpandedChange={handleExpandedChange}
|
|
onPinnedChange={onPinnedChange}
|
|
currentContext={currentContext}
|
|
onContextChange={setCurrentContext}
|
|
currentExtendedContext={currentExtendedContext}
|
|
onExtendedContextChange={setCurrentExtendedContext}
|
|
isMenuOpen={isMenuOpen}
|
|
onMenuOpenChange={setIsMenuOpen}
|
|
/>
|
|
);
|
|
};
|