lms/public/build/assets/certificate-fjkWh12T.js
2025-12-15 12:26:23 +01:00

2 lines
3.1 KiB
JavaScript

import{u as j,j as e,b5 as N,q as u,s as b,A as i,c2 as x}from"./vendor-BKmmeuxg.js";import{D as k,a as C}from"./dynamic-marksheet-1vU1WSTz.js";import{A as g,a as y,b as M}from"./alert-D9uBQ7fu.js";import{C as c,b as l}from"./card-D9_SJYq6.js";import{c as T,T as v,a as h,b as f}from"./tabs-Ifouhv9A.js";import"./button-BpNwv2aE.js";import"./index-WW_1X1qx.js";import"./utils-DxSsnXxD.js";import"./label-HmIcv5Yx.js";import"./radio-group-C0C2vfl-.js";import"./jspdf.es.min-BFMcGtlR.js";import"./index-D9-QKOod.js";const V=()=>{const{props:p}=j(),{course:o,watchHistory:s,completion:t,certificateTemplate:a,marksheetTemplate:r,studentMarks:m,auth:n}=p;if(!((s==null?void 0:s.completion_date)||(t==null?void 0:t.completion)===100))return e.jsxs(g,{children:[e.jsx(N,{className:"h-4 w-4"}),e.jsx(y,{children:"Certificate & Marksheet Locked"}),e.jsxs(M,{children:["Complete all course modules to unlock your certificate and marksheet. Your current progress: ",(t==null?void 0:t.completion)||0,"%"]})]});const d=s!=null&&s.completion_date?u(b(s.completion_date),"MMMM d, yyyy"):u(new Date,"MMMM d, yyyy");return!a&&!r?e.jsx("div",{className:"p-6",children:e.jsx(c,{children:e.jsxs(l,{className:"flex flex-col items-center justify-center p-12 text-center",children:[e.jsx(i,{className:"text-muted-foreground mb-4 h-16 w-16"}),e.jsx("h3",{className:"mb-2 text-xl font-semibold",children:"No Certificate or Marksheet Available"}),e.jsx("p",{className:"text-muted-foreground",children:"The instructor hasn't set up certificates or marksheets for this course yet."})]})})}):e.jsx("div",{children:e.jsxs(T,{defaultValue:"certificate",className:"w-full",children:[e.jsxs(v,{className:"mb-6 grid h-11 w-full grid-cols-2",children:[e.jsxs(h,{value:"certificate",className:"flex h-9 cursor-pointer items-center gap-2",children:[e.jsx(i,{className:"h-4 w-4"}),"Certificate"]}),e.jsxs(h,{value:"marksheet",className:"flex h-9 cursor-pointer items-center gap-2",children:[e.jsx(x,{className:"h-4 w-4"}),"Marksheet"]})]}),e.jsx(f,{value:"certificate",children:a?e.jsx(k,{template:a,courseName:o.title,studentName:n.user.name,completionDate:d}):e.jsx(c,{children:e.jsxs(l,{className:"flex flex-col items-center justify-center p-12 text-center",children:[e.jsx(i,{className:"text-muted-foreground mb-4 h-16 w-16"}),e.jsx("h3",{className:"mb-2 text-xl font-semibold",children:"No Certificate Available"}),e.jsx("p",{className:"text-muted-foreground",children:"The instructor hasn't set up certificates for this course yet."})]})})}),e.jsx(f,{value:"marksheet",children:!r||!m?e.jsx(c,{children:e.jsxs(l,{className:"flex flex-col items-center justify-center p-12 text-center",children:[e.jsx(x,{className:"text-muted-foreground mb-4 h-16 w-16"}),e.jsx("h3",{className:"mb-2 text-xl font-semibold",children:"No Marksheet Available"}),e.jsx("p",{className:"text-muted-foreground",children:r?"No marks data available. Complete assignments and quizzes to view your marksheet.":"The instructor hasn't set up marksheets for this course yet."})]})}):e.jsx(C,{template:r,courseName:o.title,studentName:n.user.name,completionDate:d,studentMarks:m})})]})})};export{V as default};