import{X as t,j as e,A as p}from"./app-B4bpcw8t.js";import{T as f,a as N,b as i,c as r,d as T,e as a}from"./table-B_X3HHE7.js";import{u as k,T as v,a as w,b as y,c as C}from"./useSorting-Czo23uco.js";import{B as l,C as S}from"./Combination-Cl8jHAtF.js";import{E as A}from"./eye-koJa6JwK.js";import{X as E}from"./x-DNbg0Tu3.js";import"./utils-CytzSlOG.js";import"./createLucideIcon-wJ_EE_ks.js";import"./chevron-right-DYxmcBOj.js";import"./input-CRYBtCGU.js";import"./select-BNr4ESih.js";import"./index-sg5kJuQ0.js";import"./index-DbynPVM6.js";import"./index-BnyjZpqT.js";import"./index-DokDpAic.js";function z(){const{filters:c}=t().props,h=t().props.datatable,{data:o,links:m}=t().props.datatable,{params:n,setParams:d,setTimeDebounce:x}=k(route(`${route().current()}`),c),{sort:j}=y(c,d),u=s=>{var b=window.confirm("Yakin ingin menolak peserta ini?");b==!0&&p.post(route("admin.dashboard.reject",{id:s}))},g=s=>{p.post(route("admin.dashboard.approve",{id:s}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{placeholder:"Search peserta",search:n.search,params:n,setParams:d,setTimeDebounce:x}),e.jsx("div",{className:"",children:e.jsxs(f,{children:[e.jsx(N,{children:e.jsxs(i,{children:[e.jsx(r,{children:e.jsx(w,{className:"",title:"Waktu Mendaftar",onClick:()=>{x(50),j("created_at")},sort:n.col==="created_at"?n.sort:"desc"})}),e.jsx(r,{children:"NIK"}),e.jsx(r,{children:"Nama"}),e.jsx(r,{children:"Email"}),e.jsx(r,{children:"Pelatihan"}),e.jsx(r,{children:"Status"}),e.jsx(r,{children:"Action"})]})}),e.jsx(T,{children:o.length>0?o.map(s=>e.jsxs(i,{className:"bg-white",children:[e.jsx(a,{children:s.waktu_mendaftar}),e.jsx(a,{children:s.user?s.user.peserta.nik:"-"}),e.jsx(a,{children:s.user.nama}),e.jsx(a,{children:s.user.email}),e.jsx(a,{children:s.pelatihan.title}),e.jsx(a,{children:s.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"}):s.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.show",{id:s.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:()=>g(s.id),children:e.jsx(S,{className:"w-4 h-4 text-green-500"})}),e.jsx(l,{variant:"destructive",onClick:()=>u(s.id),children:e.jsx(E,{className:"w-4 h-4 text-white"})})]})})]},s.id)):e.jsx(i,{children:e.jsx(a,{colSpan:6,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(C,{links:m,meta:h})]})}export{z as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]