import{X as i,j as e,A as p}from"./app-BFFSL0SZ.js";import{T as b,a as N,b as l,c as s,d as T,e as r}from"./table-B1xfDXsU.js";import{T as k,u as v}from"./useSorting-CbWArLy9.js";import{u as w,T as C,a as S}from"./useDebouncedSearch-BKShK9tU.js";import{B as n}from"./button-DWuAQb71.js";import{S as y}from"./scroll-D8cz_oGM.js";import{E as _}from"./eye-TZiIcJoT.js";import{C as A}from"./Combination-B3c_tr-7.js";import{X as E}from"./x-CmJ35r_p.js";import"./index-Dj7LwLcc.js";import"./index-DmKgZbBd.js";import"./createLucideIcon-Dr3RTEz4.js";import"./chevron-left-BfbkWb9-.js";import"./chevron-right-C1w8tR_T.js";import"./input-CFTx-LH_.js";import"./select-B3xIq2L2.js";import"./index-By9PgA9u.js";import"./index-Ccx_sG5V.js";import"./index-CzcCQI9I.js";function O(){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=a=>{var g=window.confirm("Yakin ingin menolak peserta ini?");g==!0&&p.post(route("admin.pendaftaran.reject",{id:a}))},f=a=>{p.post(route("admin.pendaftaran.approve",{id:a}))};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(a=>e.jsxs(l,{className:"bg-white",children:[e.jsx(r,{children:a.waktu_mendaftar}),e.jsx(r,{children:a.user?a.user.peserta.nik:"-"}),e.jsx(r,{children:a.user.nama}),e.jsx(r,{children:a.user.email}),e.jsx(r,{children:a.pelatihan.title}),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.print-sertifikat",{id:a.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:a.id}),target:"_blank",children:e.jsx(n,{variant:"outline",children:e.jsx(_,{className:"w-4 h-4 text-blue-500"})})}),a.status=="pending"&&e.jsxs(e.Fragment,{children:[e.jsx(n,{variant:"outline",onClick:()=>f(a.id),children:e.jsx(A,{className:"w-4 h-4 text-green-500"})}),e.jsx(n,{variant:"destructive",onClick:()=>u(a.id),children:e.jsx(E,{className:"w-4 h-4 text-white"})})]})]})})]},a.id)):e.jsx(l,{children:e.jsx(r,{colSpan:6,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(S,{links:h,meta:m})]})}export{O as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]