diff --git a/frontend/src/pages/InterviewPrep/InterviewPrep.jsx b/frontend/src/pages/InterviewPrep/InterviewPrep.jsx index 29e6aa2..bf7b842 100644 --- a/frontend/src/pages/InterviewPrep/InterviewPrep.jsx +++ b/frontend/src/pages/InterviewPrep/InterviewPrep.jsx @@ -2,7 +2,8 @@ import React, { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import moment from "moment"; import { AnimatePresence, motion } from "framer-motion"; -import { LuCircleAlert, LuListCollapse } from "react-icons/lu"; +import { LuCircleAlert, LuListCollapse, LuDownload } from "react-icons/lu"; +import html2pdf from "html2pdf.js"; import SpinnerLoader from "../../components/Loader/SpinnerLoader"; import { toast } from "react-hot-toast"; import DashboardLayout from "../../components/Layouts/DashboardLayout"; @@ -25,6 +26,19 @@ const InterviewPrep = () => { const [isLoading, setIsLoading] = useState(false); const [isUpdateLoader, setIsUpdateLoader] = useState(false); + const handleDownloadPdf = () => { + const element = document.getElementById("pdf-report"); + if (!element) return; + const opt = { + margin: 10, + filename: 'Interview_Feedback_Report.pdf', + image: { type: 'jpeg', quality: 0.98 }, + html2canvas: { scale: 2, useCORS: true }, + jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } + }; + html2pdf().set(opt).from(element).save(); + }; + // fetch session data const fetchSessionDetailsById = async () => { try { @@ -130,9 +144,20 @@ const InterviewPrep = () => { />
Role: {sessionData?.role || ""}
+Experience: {sessionData?.experience || "-"} {sessionData?.experience === 1 ? "Year" : "Years"}
+Date: {sessionData?.updatedAt ? moment(sessionData.updatedAt).format("MMMM Do YYYY, h:mm a") : ""}
+