fix: smart CBT result/back routing for DPPs and add Test Type selector in Admin panel
This commit is contained in:
@@ -62,6 +62,10 @@ export default function AttemptHistoryPage({ params }: { params: Promise<{ attem
|
||||
fetchHistoryData();
|
||||
}, [attemptId, userId]);
|
||||
|
||||
// Smart back route based on test type
|
||||
const backRoute = test?.type === 'DPS' ? '/dashboard/ai-coach/cbt-dpp' : '/dashboard/cbt';
|
||||
const backLabel = test?.type === 'DPS' ? '← Back to PrepPilot AI' : '← Back to Tests';
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="flex h-screen items-center justify-center">
|
||||
@@ -83,8 +87,8 @@ export default function AttemptHistoryPage({ params }: { params: Promise<{ attem
|
||||
|
||||
return (
|
||||
<div className="max-w-6xl mx-auto p-8 animate-in fade-in slide-in-from-bottom-4 duration-500">
|
||||
<Link href="/dashboard/cbt" className="inline-flex items-center text-sm text-muted-foreground hover:text-foreground mb-6 transition-colors">
|
||||
<ArrowLeft size={16} className="mr-2" /> Back to Tests
|
||||
<Link href={backRoute} className="inline-flex items-center text-sm text-muted-foreground hover:text-foreground mb-6 transition-colors">
|
||||
<ArrowLeft size={16} className="mr-2" /> {test?.type === 'DPS' ? 'Back to PrepPilot AI' : 'Back to Tests'}
|
||||
</Link>
|
||||
|
||||
<div className="flex flex-col md:flex-row gap-8 mb-10">
|
||||
|
||||
Reference in New Issue
Block a user