import{X as i,j as e,A as p}from"./app-Detnn-JW.js";import{T as b,a as N,b as l,c as s,d as T,e as a}from"./table-mjc4DbV0.js";import{T as k,u as v}from"./useSorting-DseAFtES.js";import{u as w,T as C,a as S}from"./useDebouncedSearch-CPFyUkCo.js";import{B as n}from"./button-CxlHf3sy.js";import{S as y}from"./scroll-CHi-FYb4.js";import{E as _}from"./eye-Dc8dybmw.js";import{C as A}from"./Combination-C-HLNeyJ.js";import{X as E}from"./x-B-hIkpKg.js";import"./utils-CytzSlOG.js";import"./createLucideIcon-Y7344ncw.js";import"./chevron-left-CHkoX_GS.js";import"./chevron-right-xQUr3c5y.js";import"./input-CvK1mUEL.js";import"./select-D6_kgfAW.js";import"./index-RacEM9sx.js";import"./index--tJ4ftdg.js";import"./index-DnLtHDX3.js";import"./index-BgPbD_zl.js";import"./index-BMzlgE1w.js";function Q(){const{filters:o}=i().props,m=i().props.datatable,{data:c,links:h}=i().props.datatable,{params:t,setParams:d,setTimeDebounce:x}=w(route(`${route().current()}`),o),{sort:j}=v(o,d),u=r=>{var g=window.confirm("Yakin ingin menolak peserta ini?");g==!0&&p.post(route("admin.pendaftaran.reject",{id:r}))},f=r=>{p.post(route("admin.pendaftaran.approve",{id:r}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(C,{placeholder:"Cari peserta",search:t.search,params:t,setParams:d,setTimeDebounce:x}),e.jsx("div",{className:"",children:e.jsxs(b,{children:[e.jsx(N,{children:e.jsxs(l,{children:[e.jsx(s,{children:e.jsx(k,{className:"",title:"Waktu Mendaftar",onClick:()=>{x(50),j("created_at")},sort:t.col==="created_at"?t.sort:"desc"})}),e.jsx(s,{children:"NIK"}),e.jsx(s,{children:"Nama"}),e.jsx(s,{children:"Email"}),e.jsx(s,{children:"Pelatihan"}),e.jsx(s,{children:"Status"}),e.jsx(s,{children:"Action"})]})}),e.jsx(T,{children:c.length>0?c.map(r=>e.jsxs(l,{className:"bg-white",children:[e.jsx(a,{children:r.waktu_mendaftar}),e.jsx(a,{children:r.user?r.user.peserta.nik:"-"}),e.jsx(a,{children:r.user.nama}),e.jsx(a,{children:r.user.email}),e.jsx(a,{children:r.pelatihan.title}),e.jsx(a,{children:r.status=="pending"?e.jsx("span",{className:"inline-flex items-center rounded bg-orange-50 px-2 py-0.5 text-xs font-medium text-orange-500 ring-1 ring-inset ring-orange-600/20",children:"Pending"}):r.status=="reject"?e.jsx("span",{className:"inline-flex items-center rounded bg-red-50 px-2 py-0.5 text-xs font-medium text-red-700 ring-1 ring-inset ring-red-600/10",children:"Reject"}):e.jsx("span",{className:"inline-flex items-center rounded bg-green-50 px-2 py-0.5 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20",children:"Approve"})}),e.jsx(a,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:route("admin.pendaftaran.print-sertifikat",{id:r.id}),target:"_blank",children:e.jsx(n,{variant:"outline",children:e.jsx(y,{className:"w-4 h-4 text-blue-500"})})}),e.jsx("a",{href:route("admin.pendaftaran.show",{id:r.id}),target:"_blank",children:e.jsx(n,{variant:"outline",children:e.jsx(_,{className:"w-4 h-4 text-blue-500"})})}),r.status=="pending"&&e.jsxs(e.Fragment,{children:[e.jsx(n,{variant:"outline",onClick:()=>f(r.id),children:e.jsx(A,{className:"w-4 h-4 text-green-500"})}),e.jsx(n,{variant:"destructive",onClick:()=>u(r.id),children:e.jsx(E,{className:"w-4 h-4 text-white"})})]})]})})]},r.id)):e.jsx(l,{children:e.jsx(a,{colSpan:6,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(S,{links:h,meta:m})]})}export{Q as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]