import{_,E as f,r as k,c as n,a as t,t as s,G as g,F as x,A as v,d as m,y as w,o as i,s as r,x as d,e as l}from"./app-C3pBWUn1.js";/* empty css            */const y={class:"my-2"},C={class:"d-block mb-2 mb-lg-3 fs-4 fw-bold"},T={class:"row mt-5"},$={key:0,class:"border theme-shadow rounded"},j={class:"certificate-info text-white align-items-center justify-content-center d-flex rounded-top",style:"background-image: url(/assets/images/website/certificate-unlock.png); background-size: cover; background-position: center;"},A={class:"text-center px-3"},B={class:"mb-2"},N=["onClick"],z={class:"certificate-metadata bg-light rounded-bottom px-3 pt-2 pb-3"},D={key:1,class:"border theme-shadow rounded"},V={class:"certificate-info text-white align-items-center justify-content-center d-flex rounded-top",style:"background-image: url(/assets/images/website/certificate-lock.png); background-size: cover; background-position: center;"},S={class:"text-center px-3"},E={class:"mb-0"},F={class:"certificate-metadata bg-light rounded-bottom px-3 pt-2 pb-3"},G={key:0,class:"col-12"},H={class:"text-center text-muted"},I={class:"mb-0 mt-3"},L={__name:"DashboardCertificates",setup(M){const p=f();let u=k({});axios.get("/certificate/list",{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+p.authToken}}).then(e=>{u.value=e.data.data.certificate_courses});function b(e){axios.get(`/certificate/show/${e}`,{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+p.authToken}}).then(a=>{window.open(a.data.data.url,"_blank")})}function h(e){return e.length>50?e.slice(0,50)+"...":e}return(e,a)=>{const c=w("router-link");return i(),n("section",y,[t("span",C,s(e.$t("Home"))+"/"+s(e.$t("My Certificates")),1),t("div",T,[(i(!0),n(x,null,v(m(u),o=>(i(),n("div",{class:"col-sm-6 mb-4",key:o.id},[o.is_completed?(i(),n("div",$,[t("div",j,[t("div",A,[a[0]||(a[0]=t("i",{class:"bi bi-cloud-download-fill display-5 d-block mb-3"},null,-1)),t("p",B,s(e.$t("Your course has been completed and your certificate is now ready"))+". ",1),t("a",{href:"#",onClick:Y=>b(o.id),class:"text-white"},s(e.$t("Tap here to Download")),9,N)])]),t("div",z,[r(c,{to:"/instructor/"+o.instructor.id,class:"small text-decoration-none d-block mb-1"},{default:d(()=>[l(s(o.instructor.name),1)]),_:2},1032,["to"]),r(c,{to:"/details/"+o.id,class:"fs-5 text-hover text-decoration-none"},{default:d(()=>[l(s(h(o.title)),1)]),_:2},1032,["to"])])])):(i(),n("div",D,[t("div",V,[t("div",S,[a[1]||(a[1]=t("i",{class:"bi bi-lock-fill text-white display-5 d-block mb-3"},null,-1)),t("p",E,s(e.$t("The certificate will be unlocked when your course has been finished.")),1)])]),t("div",F,[r(c,{to:"/instructor/"+o.instructor.id,class:"small text-decoration-none d-block mb-1"},{default:d(()=>[l(s(o.instructor.name),1)]),_:2},1032,["to"]),r(c,{to:"/details/"+o.id,class:"fs-5 text-hover text-decoration-none"},{default:d(()=>[l(s(h(o.title)),1)]),_:2},1032,["to"])])]))]))),128)),m(u).length===0?(i(),n("div",G,[t("div",H,[a[2]||(a[2]=t("i",{class:"bi bi-emoji-frown display-5"},null,-1)),t("p",I,s(e.$t("No Certificate Available")),1)])])):g("",!0)])])}}},K=_(L,[["__scopeId","data-v-aae4fec9"]]);export{K as default};
