import{_,E as f,r as k,c as n,o as i,a as t,t as s,D as g,F as v,h as w,b,j as x,C as r,l as d,f as l}from"./app-L4cdeQDO.js";/* empty css            */const y={class:"my-2"},C={class:"d-block mb-2 mb-lg-3 fs-4 fw-bold"},j={class:"row mt-5"},T={key:0,class:"border theme-shadow rounded"},$={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"},D=["onClick"],N={class:"certificate-metadata bg-light rounded-bottom px-3 pt-2 pb-3"},z={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"},H={key:0,class:"col-12"},I={class:"text-center text-muted"},L={class:"mb-0 mt-3"},M={__name:"DashboardCertificates",setup(Y){const h=f();let u=k({});axios.get("/certificate/list",{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+h.authToken}}).then(e=>{u.value=e.data.data.certificate_courses});function m(e){axios.get(`/certificate/show/${e}`,{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+h.authToken}}).then(a=>{window.open(a.data.data.url,"_blank")})}function p(e){return e.length>50?e.slice(0,50)+"...":e}return(e,a)=>{const c=x("router-link");return i(),n("section",y,[t("span",C,s(e.$t("Home"))+"/"+s(e.$t("My Certificates")),1),t("div",j,[(i(!0),n(v,null,w(b(u),o=>(i(),n("div",{class:"col-sm-6 mb-4",key:o.id},[o.is_completed?(i(),n("div",T,[t("div",$,[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:q=>m(o.id),class:"text-white"},s(e.$t("Tap here to Download")),9,D)])]),t("div",N,[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(p(o.title)),1)]),_:2},1032,["to"])])])):(i(),n("div",z,[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(p(o.title)),1)]),_:2},1032,["to"])])]))]))),128)),b(u).length===0?(i(),n("div",H,[t("div",I,[a[2]||(a[2]=t("i",{class:"bi bi-emoji-frown display-5"},null,-1)),t("p",L,s(e.$t("No Certificate Available")),1)])])):g("",!0)])])}}},K=_(M,[["__scopeId","data-v-aae4fec9"]]);export{K as default};
