import{X as n,j as e,A as x}from"./app-Dqm4owHT.js";import{T,a as N,b as i,c as s,d as k,e as r}from"./table-eMEisCI4.js";import{T as v,u as w}from"./useSorting-DDBwXgpG.js";import{u as y,T as C,a as S}from"./useDebouncedSearch-B9qwQSuS.js";import{B as l}from"./button-B8ZzRKBh.js";import{E as A}from"./eye-BqZdNoK7.js";import{C as _}from"./Combination-DterT_Fn.js";import{X as D}from"./x-DjRPG20W.js";import"./index-Ebf2_-ZL.js";import"./index-D3BPeFjX.js";import"./createLucideIcon-Cc-ke-6N.js";import"./chevron-left-DLAYlVa1.js";import"./chevron-right-Da1NFNyx.js";import"./input-BnJy4BfI.js";import"./select-BqCbOS6A.js";import"./index-HNzDpnpF.js";import"./index-CZi-LSRR.js";import"./index-BbqwfHyN.js";function L({pelatihanId:m}){const{filters:o}=n().props,h=n().props.datatable,{data:c,links:j}=n().props.datatable,{params:t,setParams:d,setTimeDebounce:p}=y(route(`${route().current()}`,{id:m}),o),{sort:u}=w(o,d),g=a=>{var b=window.confirm("Yakin ingin menolak peserta ini?");b==!0&&x.post(route("admin.pelatihan.reject",{id:a}))},f=a=>{x.post(route("admin.pelatihan.approve",{id:a}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(C,{placeholder:"Search peserta",search:t.search,params:t,setParams:d,setTimeDebounce:p}),e.jsx("div",{className:"",children:e.jsxs(T,{children:[e.jsx(N,{children:e.jsxs(i,{children:[e.jsx(s,{children:e.jsx(v,{className:"",title:"Waktu Mendaftar",onClick:()=>{p(50),u("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:"Asal"}),e.jsx(s,{children:"Tahun"}),e.jsx(s,{children:"Status"}),e.jsx(s,{children:"Action"})]})}),e.jsx(k,{children:c.length>0?c.map(a=>e.jsxs(i,{className:"bg-white",children:[e.jsx(r,{children:a.waktu_mendaftar}),e.jsx(r,{children:a.peserta.nik}),e.jsx(r,{children:a.peserta.nama_lengkap}),e.jsx(r,{children:a.peserta.email}),e.jsx(r,{children:a.peserta.kabupaten.name}),e.jsx(r,{children:a.peserta.tahun}),e.jsx(r,{children:a.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"}):a.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(r,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:route("admin.pendaftaran.show",{id:a.id}),target:"_blank",children:e.jsx(l,{variant:"outline",children:e.jsx(A,{className:"w-4 h-4 text-blue-500"})})}),e.jsx(l,{variant:"outline",onClick:()=>f(a.id),children:e.jsx(_,{className:"w-4 h-4 text-green-500"})}),e.jsx(l,{variant:"destructive",onClick:()=>g(a.id),children:e.jsx(D,{className:"w-4 h-4 text-white"})})]})})]},a.id)):e.jsx(i,{children:e.jsx(r,{colSpan:8,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(S,{links:j,meta:h})]})}export{L as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]