{toasterMessage &&
}
-
-
-
+
- {t("ENROLLMENT_SUCCESS_MESSAGE")}
-
-
-
-
+ {t("ENROLLMENT_SUCCESS_MESSAGE")}
+
+
+
- {t("UNENROLLMENT_SUCCESS_MESSAGE")}
-
-
-
- {
- if (reason === "backdropClick" || reason === "escapeKeyDown") {
- setOpenModal(true);
- } else {
- handleCloseModal();
- }
- }}
- >
-
-
- {t("CONSENT_FORM_TITLE")}
-
-
-
-
-
-
-
-
-
-
-
-
+ {t("UNENROLLMENT_SUCCESS_MESSAGE")}
+
+
+
+ {
+ if (reason === "backdropClick" || reason === "escapeKeyDown") {
+ setOpenModal(true);
+ } else {
+ handleCloseModal();
+ }
+ }}
+ >
+
+
+ {t("CONSENT_FORM_TITLE")}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
- {t("ALL_CONTENT")}
-
-
- {userData?.result?.content?.name}
-
-
-
-
- {" "}
- {userData?.result?.content?.name}
-
+
+ {t("ALL_CONTENT")}
+
+
+ {userData?.result?.content?.name}
+
+
+
+
+ {" "}
+ {userData?.result?.content?.name}
+
- {(courseData?.result?.content?.board ||
- courseData?.result?.content?.se_boards ||
- courseData?.result?.content?.gradeLevel ||
- courseData?.result?.content?.se_gradeLevels) && (
+ {(courseData?.result?.content?.board ||
+ courseData?.result?.content?.se_boards ||
+ courseData?.result?.content?.gradeLevel ||
+ courseData?.result?.content?.se_gradeLevels) && (
{
color: "#424242",
fontSize: "10px",
margin: "0 10px 3px 6px",
- cursor: "auto"
+ cursor: "auto",
}}
className="bg-blueShade3"
>
@@ -1166,21 +1182,23 @@ const JoinCourse = () => {
))}
{courseData?.result?.content?.se_boards &&
- courseData?.result?.content?.se_boards?.map((item, index) => (
-
- ))}
+ courseData?.result?.content?.se_boards?.map(
+ (item, index) => (
+
+ )
+ )}
{courseData?.result?.content?.gradeLevel &&
courseData?.result?.content?.gradeLevel?.map(
(item, index) => (
@@ -1191,7 +1209,7 @@ const JoinCourse = () => {
color: "#424242",
fontSize: "10px",
margin: "0 10px 3px 6px",
- cursor: "auto"
+ cursor: "auto",
}}
className="bg-blueShade3"
>
@@ -1209,7 +1227,7 @@ const JoinCourse = () => {
color: "#424242",
fontSize: "10px",
margin: "0 10px 3px 6px",
- cursor: "auto"
+ cursor: "auto",
}}
className="bg-blueShade3"
>
@@ -1219,80 +1237,144 @@ const JoinCourse = () => {
)}
)}
- {renderActionButton()}
-
-
- {t("BATCH_DETAILS")}:
-
+ {renderActionButton()}
- {t("BATCH_START_DATE")}:{" "}
- {batchData?.startDate
- ? formatDate(batchData?.startDate)
- : "Not Provided"}
+ {t("BATCH_DETAILS")}:
-
- {t("BATCH_END_DATE")}:{" "}
- {batchData?.endDate
- ? formatDate(batchData?.endDate)
- : "Not Provided"}
-
-
+ {t("BATCH_START_DATE")}:{" "}
+ {batchData?.startDate
+ ? formatDate(batchData?.startDate)
+ : "Not Provided"}
+
+
+ {t("BATCH_END_DATE")}:{" "}
+ {batchData?.endDate
+ ? formatDate(batchData?.endDate)
+ : "Not Provided"}
+
+
+ {t("LAST_DATE_FOR_ENROLLMENT")}:{" "}
+ {batchData?.enrollmentEndDate
+ ? formatDate(batchData.enrollmentEndDate)
+ : "Not Provided"}
+
+
+
+ {batchDetails && batchDetails.cert_templates != null && (
+
- {t("LAST_DATE_FOR_ENROLLMENT")}:{" "}
- {batchData?.enrollmentEndDate
- ? formatDate(batchData.enrollmentEndDate)
- : "Not Provided"}
-
-
-
- {batchDetails && batchDetails.cert_templates != null &&
+
}
+ aria-controls="panel1-content"
+ id="panel1-header"
+ className="xs-hide h4-title"
+ >
+ {t("CERTIFICATION_CRITERIA")}
+
+
+ {batchDetail && (
+
+ -
+ {t("COMPLETION_CERTIFICATE_ISSUED")}
+
+ {score !== "no certificate" && (
+ -
+ {t("CERT_ISSUED_SCORE")}
+ {` ${score}% `}
+ {t("ASSESSMENT")}
+
+ )}
+
+ )}
+
+
+ )}
+ {isEnrolled &&
+ batchDetails &&
+ batchDetails.cert_templates == null && (
+
+
+ {t("CERT_NOT_ATTACHED")}
+
+
+ )}
{
expandIcon={}
aria-controls="panel1-content"
id="panel1-header"
- className="xs-hide h4-title"
+ className="h4-title"
>
- {t("CERTIFICATION_CRITERIA")}
+ {t("OTHER_DETAILS")}
-
- {batchDetail && (
-
- -
- {t("COMPLETION_CERTIFICATE_ISSUED")}
-
- {score !== "no certificate" && (
- -
- {t("CERT_ISSUED_SCORE")}
- {` ${score}% `}
- {t("ASSESSMENT")}
-
+
+
+ {t("Created By")}:{" "}
+ {userData &&
+ userData.result &&
+ userData.result.content.creator}
+
+
+ {t("Published on NULP by")}:{" "}
+ {userData &&
+ userData.result &&
+ userData.result?.content?.orgDetails?.orgName}
+
+
+ {t("CREATED_ON")}:{" "}
+ {userData &&
+ userData.result &&
+ formatDate(userData.result.content.children[0].createdOn)}
+
+
+ {t("UPDATED_ON")}:{" "}
+ {userData &&
+ userData.result &&
+ formatDate(
+ userData.result.content.children[0].lastUpdatedOn
)}
-
- )}
-
-
- }
-
-
- {isEnrolled && batchDetails && batchDetails.cert_templates == null &&
-
-
-
- {t("CERT_NOT_ATTACHED")}
-
-
-
- }
-
- }
- aria-controls="panel1-content"
- id="panel1-header"
- className="h4-title"
- >
- {t("OTHER_DETAILS")}
-
-
-
- {t("Created By")}:{" "}
- {userData &&
- userData.result &&
- userData.result.content.creator
- }
-
-
- {t("Published on NULP by")}:{" "}
- {userData &&
- userData.result &&
- userData.result?.content?.orgDetails?.orgName
- }
-
-
- {t("CREATED_ON")}:{" "}
- {userData &&
- userData.result &&
- formatDate(userData.result.content.children[0].createdOn)}
-
-
- {t("UPDATED_ON")}:{" "}
- {userData &&
- userData.result &&
- formatDate(
- userData.result.content.children[0].lastUpdatedOn
- )}
-
-
-
- {t("CREDITS")}
-
-
-
- {t("LICENSE_TERMS")}:{" "}
- {userData?.result?.content?.licenseDetails?.name}
- {t("FOR_DETAILS")}:{" "}
-
- {userData?.result?.content?.licenseDetails?.url}
-
-
-
-
-
+
-
-
- {chat.length === 0 && (
-
- )}
- {chat.length > 0 && chat[0]?.is_accepted === false && (
-
-
- {t("YOUR_CHAT_REQUEST_IS_PENDING")}
-
+ {t("CREDITS")}
+
+
+
+ {t("LICENSE_TERMS")}:{" "}
+ {userData?.result?.content?.licenseDetails?.name}
+ {t("FOR_DETAILS")}:{" "}
+
+ {userData?.result?.content?.licenseDetails?.url}
+
+
+
+
+
+
+
+ {chat.length === 0 && (
+ )}
+ {chat.length > 0 && chat[0]?.is_accepted === false && (
+
+
+ {t("YOUR_CHAT_REQUEST_IS_PENDING")}
+
+
+
+ )}
+ {chat.length > 0 && chat[0].is_accepted === true && (
+
-
- )}
- {chat.length > 0 && chat[0].is_accepted === true && (
-
+ )}
+
+ {_userId && creatorId && (
+
+
+ {" "}
+
+
)}
-
- {_userId && creatorId && (
-
-
- {" "}
-
-
- )}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {" "}
- {renderActionButton()}
-
-
- {courseData && courseData?.result?.content && (
- <>
-
- {t("DESCRIPTION")}:
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {" "}
+ {renderActionButton()}
+
+
+ {courseData && courseData?.result?.content && (
+ <>
+
+ {t("DESCRIPTION")}:
+
+
+ {courseData?.result?.content?.description.split(" ")
+ .length > 100
+ ? showMore
+ ? courseData?.result?.content?.description
+ : courseData?.result?.content?.description
+ .split(" ")
+ .slice(0, 30)
+ .join(" ") + "..."
+ : courseData?.result?.content?.description}
+
{courseData?.result?.content?.description.split(" ")
- .length > 100
- ? showMore
- ? courseData?.result?.content?.description
- : courseData?.result?.content?.description
- .split(" ")
- .slice(0, 30)
- .join(" ") + "..."
- : courseData?.result?.content?.description}
-
- {courseData?.result?.content?.description.split(" ").length >
- 100 && (
+ .length > 100 && (
)}
- >
- )}
-
+ >
+ )}
+
-
- }
- aria-controls="panel1-content"
- id="panel1-header"
- className="h4-title"
- style={{ fontWeight: "500" }}
+
- {t("COURSES_MODULE")}
-
-
- {userData?.result?.content?.children.map((faqIndex) => (
-
- }
- aria-controls={`panel${faqIndex.id}-content`}
- id={`panel${faqIndex.id}-header`}
- className="h5-title"
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ className="h4-title"
+ style={{ fontWeight: "500" }}
+ >
+ {t("COURSES_MODULE")}
+
+
+ {userData?.result?.content?.children.map((faqIndex) => (
+
- {faqIndex.name}
-
- {faqIndex?.children?.map((faqIndexname) => (
-
- handleLinkClick(faqIndexname.identifier)
- }
- className="h6-title"
+ }
+ aria-controls={`panel${faqIndex.id}-content`}
+ id={`panel${faqIndex.id}-header`}
+ className="h5-title"
>
-
- {faqIndexname.children &&
- faqIndexname.children.length > 0 ? (
-
+
+
+ {/* If it's not a content collection, render it like a clickable child */}
+ {faqIndex.mimeType !==
+ "application/vnd.ekstep.content-collection" ? (
+ handleLinkClick(faqIndex.identifier)}
+ className="h6-title"
+ >
+ {faqIndex.name}
+ {completedContents.includes(
+ faqIndex.identifier
+ ) && (
+
+ )}
+
+ ) : (
+ faqIndex?.children?.map((faqIndexname) => (
+
- {faqIndexname.name}
-
- ) : (
- {faqIndexname.name}
- {completedContents.includes(
- faqIndexname.identifier
- ) && (
-
- )}
-
-
- )}
- {faqIndexname.children &&
- faqIndexname.children.length > 0 && (
-
- {faqIndexname.children.map((child) => (
-
- {child.children &&
- child.children.length > 0 ? (
- 0 ? (
+
+ {faqIndexname.name}
+
+ ) : (
+
+ handleLinkClick(faqIndexname.identifier)
+ }
+ className="h6-title"
+ >
+ {faqIndexname.name}
+ {completedContents.includes(
+ faqIndexname.identifier
+ ) && (
+
+ )}
+
+ )}
+
+ {faqIndexname.children &&
+ faqIndexname.children.length > 0 && (
+
+ {faqIndexname.children.map((child) => (
+
- {child.name}
-
- ) : (
-
- handleLinkClick(child.identifier)
- }
- className="h6-title"
- >
- {child.name}
- {completedContents.includes(
- child.identifier
- ) && (
-
- )}
-
- )}
- {child.children &&
- child.children.length > 0 && (
-
- {child.children.map((grandchild) => (
-
0 ? (
+
+ {child.name}
+
+ ) : (
+
+ handleLinkClick(child.identifier)
+ }
+ className="h6-title"
+ >
+ {child.name}
+ {completedContents.includes(
+ child.identifier
+ ) && (
+
+ )}
+
+ )}
+ {child.children &&
+ child.children.length > 0 && (
+
- {grandchild.children &&
- grandchild.children.length > 0 ? (
-
- {grandchild.name}
-
- ) : (
-
- handleLinkClick(
- grandchild.identifier
- )
- }
- className="h6-title"
- >
- {grandchild.name}
- {completedContents.includes(
- grandchild.identifier
- ) && (
-
(
+
+ {grandchild.children &&
+ grandchild.children.length >
+ 0 ? (
+
+ {grandchild.name}
+
+ ) : (
+
+ onClick={() =>
+ handleLinkClick(
+ grandchild.identifier
+ )
+ }
+ className="h6-title"
+ >
+ {grandchild.name}
+ {completedContents.includes(
+ grandchild.identifier
+ ) && (
+
+ )}
+
)}
-
+
+ )
)}
-
- ))}
-
- )}
-
- ))}
-
- )}
-
-
- ))}
-
- ))}
-
-
-
-
- {t("BATCH_DETAILS")}:
-
+
+ )}
+
+ ))}
+
+ )}
+
+ ))
+ )}
+
+
+ ))}
+
+
- {t("BATCH_START_DATE")}: {formatDate(batchData?.startDate)}
+ {t("BATCH_DETAILS")}:
-
- {t("BATCH_END_DATE")}: {formatDate(batchData?.endDate)}
-
-
+ {t("BATCH_START_DATE")}: {formatDate(batchData?.startDate)}
+
+
+ {t("BATCH_END_DATE")}: {formatDate(batchData?.endDate)}
+
+
+ {t("LAST_DATE_FOR_ENROLLMENT")}:{" "}
+ {formatDate(batchData?.enrollmentEndDate)}
+
+
+
+ {batchDetails && batchDetails.cert_templates != null && (
+
- {t("LAST_DATE_FOR_ENROLLMENT")}:{" "}
- {formatDate(batchData?.enrollmentEndDate)}
-
-
-
- {batchDetails && batchDetails.cert_templates != null &&
+ }
+ aria-controls="panel1-content"
+ id="panel1-header"
+ className="h4-title"
+ >
+ {t("CERTIFICATION_CRITERIA")}
+
+
+ {batchDetail && (
+
+ -
+ {t("COMPLETION_CERTIFICATE_ISSUED")}
+
+ {score !== "no certificate" && (
+ -
+ {t("CERT_ISSUED_SCORE")}
+ {` ${score}% `}
+ {t("ASSESSMENT")}
+
+ )}
+
+ )}
+
+
+ )}
+ {isEnrolled &&
+ batchDetails &&
+ batchDetails.cert_templates == null && (
+
+
+ {t("CERT_NOT_ATTACHED")}:
+
+
+ )}
{
id="panel1-header"
className="h4-title"
>
- {t("CERTIFICATION_CRITERIA")}
+ {t("OTHER_DETAILS")}
{
borderRadius: "10px",
}}
>
- {batchDetail && (
-
- -
- {t("COMPLETION_CERTIFICATE_ISSUED")}
-
- {score !== "no certificate" && (
- -
- {t("CERT_ISSUED_SCORE")}
- {` ${score}% `}
- {t("ASSESSMENT")}
-
+
+ {t("CREATED_ON")}:{" "}
+ {courseData &&
+ courseData.result &&
+ formatDate(
+ courseData.result.content.children[0].createdOn
)}
-
- )}
+
+
+ {t("UPDATED_ON")}:{" "}
+ {courseData &&
+ courseData.result &&
+ formatDate(
+ courseData.result.content.children[0].lastUpdatedOn
+ )}
+
+ {t("CREDITS")}:
+
+ {t("LICENSE_TERMS")}:{" "}
+ {courseData?.result?.content?.licenseDetails?.name}
+ {t("FOR_DETAILS")}:{" "}
+
+ {courseData?.result?.content?.licenseDetails?.url}
+
+
- }
-
- {isEnrolled && batchDetails && batchDetails.cert_templates == null &&
-
-
-
- {t("CERT_NOT_ATTACHED")}:
-
-
-
- }
-
- }
- aria-controls="panel1-content"
- id="panel1-header"
- className="h4-title"
- >
- {t("OTHER_DETAILS")}
-
-
-
- {t("CREATED_ON")}:{" "}
- {courseData &&
- courseData.result &&
- formatDate(courseData.result.content.children[0].createdOn)}
-
-
- {t("UPDATED_ON")}:{" "}
- {courseData &&
- courseData.result &&
- formatDate(
- courseData.result.content.children[0].lastUpdatedOn
+
+
+ {chat && chat.length === 0 && (
+
+ )}
+ {chat &&
+ chat.length > 0 &&
+ chat[0]?.is_accepted === false && (
+
+
+ {t("YOUR_CHAT_REQUEST_IS_PENDING")}
+
+
+
)}
-
- {t("CREDITS")}:
-
- {t("LICENSE_TERMS")}:{" "}
- {courseData?.result?.content?.licenseDetails?.name}
- {t("FOR_DETAILS")}:{" "}
-
- {courseData?.result?.content?.licenseDetails?.url}
-
-
-
-
-
-
- {chat && chat.length === 0 && (
-
- )}
- {chat && chat.length > 0 && chat[0]?.is_accepted === false && (
-
-
- {t("YOUR_CHAT_REQUEST_IS_PENDING")}
-
+ {chat && chat.length > 0 && chat[0].is_accepted === true && (
-
- )}
- {chat && chat.length > 0 && chat[0].is_accepted === true && (
-
+ )}
+
+ {_userId && creatorId && (
+
+
+ {" "}
+
+
)}
-
- {_userId && creatorId && (
-
-
- {" "}
-
-
- )}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
diff --git a/packages/nulp_elite/src/pages/events/eventDetails.js b/packages/nulp_elite/src/pages/events/eventDetails.js
index 5c5e92e8..66245d55 100644
--- a/packages/nulp_elite/src/pages/events/eventDetails.js
+++ b/packages/nulp_elite/src/pages/events/eventDetails.js
@@ -109,6 +109,8 @@ const EventDetails = () => {
const [isChecked, setIsChecked] = useState(false);
const [open, setOpen] = React.useState(false);
const [recording, setRecording] = useState();
+ const [batchCertData,setBatchCertData] = useState();
+ const [isCertificateIssued , setIsCertificateIssued] = useState(true)
const [isAllreadyFilledRegistation,setIsAlreadyFilledRegistration] = useState(true)
const [isExpired , setIsExpired] = useState(false)
const handleClickOpen = () => {
@@ -286,6 +288,8 @@ const formatTimeWithTimezone = (date) => {
getUserData(_userId, "loggedIn");
fetchMyEvents();
getEventRecording();
+ fetchData();
+ checkCertificateAlreadyIssued();
// checkEnrolledCourse();
}, [_userId, eventId]);
@@ -308,6 +312,7 @@ const formatTimeWithTimezone = (date) => {
const { result } = response.data;
const { response: batchResponse } = result;
+ setBatchCertData(response.data.result)
if (batchResponse && batchResponse.count === 0) {
showErrorMessage(t("This course has no active Batches"));
@@ -455,6 +460,83 @@ const formatTimeWithTimezone = (date) => {
});
};
+ const fetchData = async () => {
+ try {
+ const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.USER.GET_PROFILE}${_userId}?fields=${urlConfig.params.userReadParam.fields}`;
+
+ const header = "application/json";
+ const response = await fetch(url, {
+ // headers: {
+ // "Content-Type": "application/json",
+ // },
+ });
+ const data = await response.json();
+ setUserData(data);
+ } catch (error) {
+ console.error("Error fetching user data:", error);
+ showErrorMessage(t("FAILED_TO_FETCH_DATA"));
+ }
+ };
+
+ const checkCertificateAlreadyIssued = async () => {
+ try{
+ const url = `${urlConfig.URLS.LEARNER_PREFIX}${urlConfig.URLS.CERTIFICATE.CERTIF_SEARCH}`;
+ const requestBody = {
+ filters: {
+ recipient: {
+ id: {
+ eq: _userId
+ }
+ }
+ }
+ }
+ const resopnse = await axios.post(url, requestBody);
+ setIsCertificateIssued(resopnse.data.some((item) => item.training?.id === eventId));
+
+ }catch(error){
+ console.log("error While calling API ");
+ }
+
+ }
+
+ const generateCertificate = async () => {
+ const templateId = Object.keys(batchCertData?.response?.content[0]["certTemplates"])[0];
+ const certificateDetails = batchCertData?.response?.content[0]["certTemplates"][templateId];
+ try {
+ const url = `${urlConfig.URLS.CERTIFICATE.CUSTOM_CERTIFICATE_CREATE}`;
+ const requestBody = {
+ recipient: {
+ id: _userId,
+ name: userData?.result?.response?.firstName + " " + userData?.result?.response?.lastName,
+ type: "user",
+ },
+ issuer: certificateDetails?.issuer,
+ training: {
+ id: detailData?.identifier,
+ name: detailData?.name,
+ type: "Event",
+ batchId: batchData?.batchId,
+ },
+ templateUrl:
+ certificateDetails?.url,
+ status: "ACTIVE",
+ signatoryList:
+ certificateDetails?.signatoryList,
+ certificateLabel: "test",
+ issuedOn: new Date().toISOString(),
+ };
+ if(!isCertificateIssued){
+ const response = await axios.post(url, requestBody);
+ if(response.data.responseCode === "OK"){
+ setIsCertificateIssued(true)
+ }
+ }
+ } catch (error) {
+ console.error("Error creating certificate:", error);
+ }
+};
+
+
const managePublicPrivateEvent = (button) => {
if (eventVisibility && eventVisibility === "Public" && button === "reg") {
handleOpenConsentModal();
@@ -865,6 +947,10 @@ const formatTimeWithTimezone = (date) => {
type="button"
onClick={() => {
managePublicPrivateEvent("join");
+ // generateCertificate();
+ if(detailData.issueCerificate === "Yes"){
+ generateCertificate();
+ }
}}
// onClick={attendWebinar}
style={{
diff --git a/packages/nulp_elite/src/pages/learnathon/LernReview.js b/packages/nulp_elite/src/pages/learnathon/LernReview.js
new file mode 100644
index 00000000..e69de29b
diff --git a/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js
new file mode 100644
index 00000000..d4e0e581
--- /dev/null
+++ b/packages/nulp_elite/src/pages/learnathon/lernCreatorForm.js
@@ -0,0 +1,296 @@
+import React, { useState } from "react";
+import {
+ TextField,
+ Button,
+ MenuItem,
+ Checkbox,
+ FormControlLabel,
+ Tooltip,
+ IconButton,
+ Typography,
+ Box,
+} from "@mui/material";
+import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
+
+const categories = [
+ "State / UT / SPVs / ULBs / Any Other",
+ "Industry",
+ "Academia",
+];
+
+const themes = [
+ "NULP Domain 1",
+ "NULP Domain 2",
+ "NULP Domain 3",
+ "NULP Domain 4",
+ "NULP Domain 5",
+ "NULP Domain 6",
+ "NULP Domain 7",
+ "NULP Domain 8",
+ "NULP Domain 9",
+ "NULP Domain 10",
+ "Others",
+];
+
+const LernCreatorForm = () => {
+ const [formData, setFormData] = useState({
+ userName: "",
+ email: "",
+ mobileNumber: "",
+ category: "",
+ organisation: "",
+ department: "",
+ theme: "",
+ otherTheme: "",
+ title: "",
+ description: "",
+ file: null,
+ consent: false,
+ });
+
+ const [guidelineLink, setGuidelineLink] = useState("");
+
+ const handleChange = (e) => {
+ const { name, value } = e.target;
+ setFormData({
+ ...formData,
+ [name]: value,
+ });
+ };
+
+ const handleFileChange = (e) => {
+ setFormData({
+ ...formData,
+ file: e.target.files[0],
+ });
+ };
+
+ const handleCheckboxChange = (e) => {
+ setFormData({
+ ...formData,
+ consent: e.target.checked,
+ });
+ };
+
+ const handleCategoryChange = (e) => {
+ const category = e.target.value;
+ setFormData({ ...formData, category });
+
+ // Set appropriate guideline link based on category
+ if (category === "State / UT / SPVs / ULBs / Any Other") {
+ setGuidelineLink("link-to-state-guidelines.pdf");
+ } else if (category === "Industry") {
+ setGuidelineLink("link-to-industry-guidelines.pdf");
+ } else if (category === "Academia") {
+ setGuidelineLink("link-to-academia-guidelines.pdf");
+ } else {
+ setGuidelineLink("");
+ }
+ };
+
+ const handleSubmit = (action) => {
+ if (!formData.consent) {
+ alert("You must accept the terms and conditions.");
+ return;
+ }
+
+ // Handle form submission (draft or review)
+ console.log("Form submitted:", formData);
+ if (action === "draft") {
+ alert("Saved as draft");
+ } else if (action === "review") {
+ alert("Sent for review");
+ }
+ };
+
+ return (
+