feat: setup admin JSON generation and pdf viewer for free plan DPPs
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { CheckCircle2, XCircle, AlertCircle, Clock, Award, ArrowRight, RotateCcw } from "lucide-react";
|
||||
import { CheckCircle2, XCircle, AlertCircle, Clock, Award, ArrowRight, RotateCcw, Share2, Mail } from "lucide-react";
|
||||
|
||||
interface ExamAttemptPayload {
|
||||
score: number;
|
||||
@@ -153,6 +153,26 @@ export function ExamResult({ payload, attemptId, onRetake }: ExamResultProps) {
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-center pt-8 border-t border-border mt-8 space-y-4">
|
||||
<h3 className="text-xl font-bold tracking-tight">Challenge a Friend</h3>
|
||||
<p className="text-muted-foreground text-center max-w-md">Share this test with your friends and see if they can beat your score of {finalScore}!</p>
|
||||
<div className="flex gap-4">
|
||||
<Button variant="outline" className="gap-2 font-bold rounded-xl" onClick={() => {
|
||||
const subject = encodeURIComponent("Can you beat my PragatiVeer Mock Test Score?");
|
||||
const body = encodeURIComponent(`I just scored ${finalScore}/${maxPossibleScore} with ${Math.round(payload.accuracy)}% accuracy in a PragatiVeer Mock Test!\n\nTake the challenge here: https://pragativeer.com/challenge`);
|
||||
window.open(`mailto:?subject=${subject}&body=${body}`);
|
||||
}}>
|
||||
<Mail className="size-4" /> Share via Email
|
||||
</Button>
|
||||
<Button className="gap-2 font-bold rounded-xl bg-green-500 hover:bg-green-600 text-white shadow-lg" onClick={() => {
|
||||
const text = encodeURIComponent(`I just scored ${finalScore}/${maxPossibleScore} in a PragatiVeer Mock Test! Can you beat me? \nTake the challenge here: https://pragativeer.com/challenge`);
|
||||
window.open(`https://wa.me/?text=${text}`, '_blank');
|
||||
}}>
|
||||
<Share2 className="size-4" /> Share on WhatsApp
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user