1import{r as d,l as p,d as a,o as r,a as e,t as s,F as h,g as _,n as g}from"./app-DDSQZi8b.js";const b={class:"rounded-lg border border-gray-200 bg-white p-6"},v={class:"flex items-center justify-between"},f={class:"text-lg font-semibold text-gray-900"},x={class:"inline-flex rounded-lg border border-gray-200 p-0.5"},k=["onClick"],w={class:"relative mt-4 min-h-[200px]"},$={key:0,class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60"},C={key:1,class:"py-10 text-center text-sm text-gray-500"},U={key:2,class:"overflow-x-auto"},j={class:"w-full"},B={class:"text-left text-xs font-medium uppercase tracking-wide text-gray-500"},M={class:"pb-3 pr-4"},z={class:"pb-3 pr-4"},F={class:"pb-3 pr-4"},L={class:"divide-y divide-gray-100"},N={class:"py-3 pr-4"},P={class:"text-sm font-semibold text-gray-900"},V={class:"py-3 pr-4 text-sm text-gray-600"},D={class:"py-3 pr-4 whitespace-nowrap text-sm text-gray-600"},E={class:"mt-4 flex items-end justify-end border-t border-gray-100 pt-4"},S={class:"text-right"},T=["href"],A={__name:"CourseUsage",setup(W){const y=[{key:"week",label:"Week"},{key:"month",label:"Month"},{key:"year",label:"Year"},{key:"all",label:"Last 3 years"}],n=d(!0),l=d("all"),i=d([]),c=async()=>{n.value=!0;try{const{data:t}=await axios.get("/team/api/course-usage",{params:{period:l.value}});i.value=t.courses??[]}finally{n.value=!1}},m=t=>{t!==l.value&&(l.value=t,c())};return p(c),(t,u)=>(r(),a("div",b,[e("div",v,[e("h3",f,s(t.$t("Course Usage")),1),e("div",x,[(r(),a(h,null,_(y,o=>e("button",{key:o.key,type:"button",onClick:Y=>m(o.key),class:g(["rounded-md px-3 py-1 text-sm font-medium transition",l.value===o.key?"bg-green-schoolism text-white":"text-gray-500 hover:text-gray-700"])},s(t.$t(o.label)),11,k)),64))])]),e("div",w,[n.value?(r(),a("div",$,u[0]||(u[0]=[e("div",{class:"h-8 w-8 border-4 border-green-schoolism-500 border-t-transparent rounded-full animate-spin"},null,-1)]))):i.value.length===0?(r(),a("div",C,s(t.$t("No course usage for this period.")),1)):(r(),a("div",U,[e("table",j,[e("thead",null,[e("tr",B,[e("th",M,s(t.$t("Course")),1),e("th",z,s(t.$t("Members")),1),e("th",F,s(t.$t("Time watched")),1)])]),e("tbody",L,[(r(!0),a(h,null,_(i.value,o=>(r(),a("tr",{key:o.id},[e("td",N,[e("span",P,s(o.title),1)]),e("td",V,s(o.members),1),e("td",D,s(o.hours)+" "+s(t.$t(o.hoursUnit??"hrs")),1)]))),128))])])]))]),e("div",E,[e("div",S,[e("a",{href:t.route("team-leader.course-usage-report"),class:"text-sm font-semibold text-green-sch
1oolism hover:underline"},s(t.$t("View all"))+" â ",9,T)])])]))}};export{A as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.