1import{I as V}from"./CUIJ45Vy.js";import{_ as k}from"./QsblEing.js";import{_ as N}from"./CN_hNDnG.js";import{E as b,a as C,c as A,w as B,g as D,o as n,h as i,i as s,m as p,L as q,b as l,p as d,l as f,F,r as I,q as L,A as S,d as $,y as E,N as R,k as U,t as j}from"./Dmpfwdmt.js";import"./BNO3U_29.js";import"./SNFQIzzR.js";import"./BuauWSjx.js";import"./DIhur4kI.js";import"./DUVfk93a.js";import"./BESgyjMO.js";const T={class:"space-y-4"},Y={class:"flex items-center justify-between"},z={class:"flex items-center gap-2"},G={class:"flex flex-col md:flex-row gap-4"},H={class:"flex-1"},J={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4"},K={class:"p-0 m-0"},M={key:0,class:"col-span-full text-center text-gray-500 py-8"},re=b({__name:"index",props:{reps_courses:{},reps:{}},async setup(x){let r,_;const c=x,h=c?.reps_courses[0]?.matrix.courses.map(o=>o.route),{user:m}=C(),{path:O}=A(),t=S(""),{data:u,refresh:y}=([r,_]=B(async()=>$("students",async()=>await E(R({fields:["id","first_name","preferred_first_name","last_name","email"],filter:{student_data:{...c.reps[0].head_rep?{department_code:{_eq:m?.value?.student_data?.department_code}}:{_and:[{route_id:{_in:h}},{level_code:{_eq:m?.value?.student_data?.level_code}}]}},...t.value.trim()?{_or:[{preferred_first_name:{_icontains:t.value}},{first_name:{_icontains:t.value}},{last_name:{_icontains:t.value}},{email:{_icontains:t.value}}]}:{}},sort:["preferred_first_name","first_name","last_name"],limit:-1})))),r=await r,_(),r);return D(t,o=>{o&&y()}),(o,e)=>{const v=V,g=k,w=N;return n(),i("div",T,[s("div",Y,[e[1]||(e[1]=s("h1",{class:"text-2xl font-bold"},"Students",-1)),s("div",z,[p(v,{modelValue:l(t),"onUpdate:modelValue":e[0]||(e[0]=a=>q(t)?t.value=a:null),icon:"i-heroicons-magnifying-glass-20-solid",placeholder:"Search",type:"text"},null,8,["modelValue"])])]),s("p",null,[e[3]||(e[3]=d(" View the students you represent on your course. You can use the search bar to find a student by name or email address. Find out more ",-1)),p(g,{href:"/course-rep-feedback-platform"},{default:f(()=>[...e[2]||(e[2]=[d("here",-1)])]),_:1}),e[4]||(e[4]=d(" . ",-1))]),s("div",G,[s("div",H,[s("div",J,[(n(!0),i(F,null,I(l(u),a=>(n(),U(w,{key:a.id,title:`${a.preferred_first_name||a.first_name} ${a.last_name}`},{description:f(()=>[s("p",K,j(a.email),1)]),_:2},1032,["title"]))),128)),l(u).length===0?(n(),i("div",M," No students found. ")):L("",!0)])])])])}}});export{re 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.