import{X as i,j as e,x as b,A as T}from"./app-Bovtsm3z.js";import{T as f,a as N,b as l,c as r,d as g,e as s}from"./table-tL4Lt2GO.js";import{T as w,u as k}from"./useSorting-BMuQ7wL3.js";import{u as v,T as y,a as D}from"./useDebouncedSearch-C3eUVB62.js";import{B as n}from"./button-CzS7pkis.js";import{E}from"./eye-tzF_8mFc.js";import{P as _,T as P}from"./trash-B2EVDyiz.js";import"./utils-CytzSlOG.js";import"./createLucideIcon-DacnXw-F.js";import"./chevron-left-BKa8e32F.js";import"./chevron-right-CbL5EKOI.js";import"./input-pA_PbStL.js";import"./select-CrNdvawf.js";import"./Combination-Buc5F2BK.js";import"./index-CawRJkUp.js";import"./index-BhHHdEWH.js";import"./index-QA9gyqW5.js";function J(){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{J as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]