import{X as i,j as e,x as b,A as T}from"./app-D2JwjYzT.js";import{T as f,a as N,b as l,c as r,d as g,e as s}from"./table-c1MlsgP6.js";import{T as w,u as k}from"./useSorting-Cvl4dyPo.js";import{u as v,T as y,a as D}from"./useDebouncedSearch-BY8wwI0G.js";import{B as n}from"./button-D-1Ohq5W.js";import{E}from"./eye-Fai_C9Aj.js";import{P as _,T as P}from"./trash-BLTbRoW6.js";import"./utils-CytzSlOG.js";import"./createLucideIcon-DdsdLXc6.js";import"./chevron-left-BhRK9jGo.js";import"./chevron-right-BNJRRMYt.js";import"./input-BgSsLD7a.js";import"./select-DtRkOcPA.js";import"./Combination-BmajjoCK.js";import"./index-jXaZ3mkd.js";import"./index-81VG6Rcq.js";import"./index-BwzCImJK.js";import"./index-AWX3shdE.js";function M(){const{filters:o}=i().props,x=i().props.datatable,{data:c,links:m}=i().props.datatable,{params:t,setParams:d,setTimeDebounce:h}=v(route(`${route().current()}`),o),{sort:p}=k(o,d),j=a=>{var u=window.confirm("Yakin ingin menghapus data ini?");u==!0&&T.post(route("admin.peserta.destroy",{id:a}),{_method:"DELETE"})};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(y,{placeholder:"Cari peserta",search:t.search,params:t,setParams:d,setTimeDebounce:h}),e.jsx("div",{className:"",children:e.jsxs(f,{children:[e.jsx(N,{children:e.jsxs(l,{children:[e.jsx(r,{children:e.jsx(w,{className:"",title:"Waktu Dibuat",onClick:()=>{h(50),p("created_at")},sort:t.col==="created_at"?t.sort:"desc"})}),e.jsx(r,{children:"NIK"}),e.jsx(r,{children:"Nama"}),e.jsx(r,{children:"Email"}),e.jsx(r,{children:"Punya Akun?"}),e.jsx(r,{children:"Action"})]})}),e.jsx(g,{children:c.length>0?c.map(a=>e.jsxs(l,{className:"bg-white",children:[e.jsx(s,{children:a.created_at!=null?new Date(Date.parse(a.created_at)).toLocaleString():"-"}),e.jsx(s,{children:a.nik}),e.jsx(s,{children:a.nama_lengkap}),e.jsx(s,{children:a.email??(a.user!=null?a.user.email:"-")}),e.jsx(s,{children:a.user!=null?"Iya":"Tidak"}),e.jsx(s,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:route("admin.peserta.show",{id:a.id}),children:e.jsx(n,{variant:"outline",children:e.jsx(E,{className:"w-4 h-4 text-blue-500"})})}),e.jsx(b,{href:route("admin.peserta.edit",{id:a.id}),children:e.jsx(n,{variant:"secondary",children:e.jsx(_,{className:"w-4 h-4 text-gray-500"})})}),e.jsx(n,{variant:"destructive",onClick:()=>j(a.id),children:e.jsx(P,{className:"w-4 h-4 text-white"})})]})})]},a.id)):e.jsx(l,{children:e.jsx(s,{colSpan:6,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(D,{links:m,meta:x})]})}export{M as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]