fix: Resolve Server Component serialization error on shared links
All checks were successful
Automated Container Build / build-and-push (push) Successful in 51s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 51s
This commit is contained in:
parent
cab4757be2
commit
a65e371449
3 changed files with 10 additions and 13 deletions
|
|
@ -87,11 +87,6 @@ export default async function SharedPage(props: SharedPageProps) {
|
||||||
}}
|
}}
|
||||||
retakeIds={null}
|
retakeIds={null}
|
||||||
isShared={true}
|
isShared={true}
|
||||||
onFinished={() => {
|
|
||||||
// In shared mode, finishes local results display, when closed we can reload
|
|
||||||
// but QuizViewer doesn't handle the restart well in shared mode if we just close.
|
|
||||||
// We'll let it stay on results or the user can refresh.
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ interface QuizResultsProps {
|
||||||
quiz: any; // QuizData
|
quiz: any; // QuizData
|
||||||
attempt: any; // QuizAttempt
|
attempt: any; // QuizAttempt
|
||||||
onRetake: (missedIds: string[]) => void;
|
onRetake: (missedIds: string[]) => void;
|
||||||
onClose: () => void;
|
onClose?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function QuizResults({ quiz, attempt, onRetake, onClose }: QuizResultsProps) {
|
export function QuizResults({ quiz, attempt, onRetake, onClose }: QuizResultsProps) {
|
||||||
|
|
@ -72,12 +72,14 @@ export function QuizResults({ quiz, attempt, onRetake, onClose }: QuizResultsPro
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex justify-center gap-4">
|
<div className="flex justify-center gap-4">
|
||||||
<button
|
{onClose && (
|
||||||
onClick={onClose}
|
<button
|
||||||
className="px-6 py-2.5 rounded-lg border border-border text-text-heading font-medium hover:bg-bg-surface-alt transition-all duration-200 cursor-pointer"
|
onClick={onClose}
|
||||||
>
|
className="px-6 py-2.5 rounded-lg border border-border text-text-heading font-medium hover:bg-bg-surface-alt transition-all duration-200 cursor-pointer"
|
||||||
Back to Quizzes
|
>
|
||||||
</button>
|
Back to Quizzes
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
{missedIds.length > 0 && (
|
{missedIds.length > 0 && (
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ interface QuizViewerProps {
|
||||||
};
|
};
|
||||||
retakeIds: string[] | null;
|
retakeIds: string[] | null;
|
||||||
isShared?: boolean;
|
isShared?: boolean;
|
||||||
onFinished: () => void;
|
onFinished?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function QuizViewer({ quiz, retakeIds, isShared = false, onFinished }: QuizViewerProps) {
|
export function QuizViewer({ quiz, retakeIds, isShared = false, onFinished }: QuizViewerProps) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue