import{X as n,j as e,A as p}from"./app-D0phMcm8.js";import{T as f,a as N,b as i,c as a,d as T,e as s}from"./table-DEpMBiGb.js";import{T as k,u as v}from"./useSorting-CDNV57kE.js";import{u as w,T as C,a as y}from"./useDebouncedSearch-DjHiSIZ1.js";import{B as l}from"./button-DbngCeXs.js";import{E as S}from"./eye-C8pb9yKx.js";import{C as A}from"./Combination--X2dxDPb.js";import{X as E}from"./x-6v8OM6Yr.js";import"./index-YOUaBSyu.js";import"./index-Bd6qtopx.js";import"./createLucideIcon-C59q94qj.js";import"./chevron-left-CKjkQOoE.js";import"./chevron-right-CjtAt_n8.js";import"./input-fl17Yger.js";import"./select-DumUDtWK.js";import"./index-DmNUKXr2.js";import"./index-CqwfMS9E.js";import"./index-G1xIjYhy.js";function J(){const{filters:o}=n().props,m=n().props.datatable,{data:c,links:h}=n().props.datatable,{params:t,setParams:d,setTimeDebounce:x}=w(route(`${route().current()}`),o),{sort:j}=v(o,d),u=r=>{var b=window.confirm("Yakin ingin menolak peserta ini?");b==!0&&p.post(route("admin.dashboard.reject",{id:r}))},g=r=>{p.post(route("admin.dashboard.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(f,{children:[e.jsx(N,{children:e.jsxs(i,{children:[e.jsx(a,{children:e.jsx(k,{className:"",title:"Waktu Mendaftar",onClick:()=>{x(50),j("created_at")},sort:t.col==="created_at"?t.sort:"desc"})}),e.jsx(a,{children:"NIK"}),e.jsx(a,{children:"Nama"}),e.jsx(a,{children:"Email"}),e.jsx(a,{children:"Pelatihan"}),e.jsx(a,{children:"Status"}),e.jsx(a,{children:"Action"})]})}),e.jsx(T,{children:c.length>0?c.map(r=>e.jsxs(i,{className:"bg-white",children:[e.jsx(s,{children:r.waktu_mendaftar}),e.jsx(s,{children:r.user?r.user.peserta.nik:"-"}),e.jsx(s,{children:r.user.nama}),e.jsx(s,{children:r.user.email}),e.jsx(s,{children:r.pelatihan.title}),e.jsx(s,{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(s,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:route("admin.pendaftaran.show",{id:r.id}),target:"_blank",children:e.jsx(l,{variant:"outline",children:e.jsx(S,{className:"w-4 h-4 text-blue-500"})})}),e.jsx(l,{variant:"outline",onClick:()=>g(r.id),children:e.jsx(A,{className:"w-4 h-4 text-green-500"})}),e.jsx(l,{variant:"destructive",onClick:()=>u(r.id),children:e.jsx(E,{className:"w-4 h-4 text-white"})})]})})]},r.id)):e.jsx(i,{children:e.jsx(s,{colSpan:6,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(y,{links:h,meta:m})]})}export{J as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]