import{X as i,j as e,A as c}from"./app-Dqm4owHT.js";import{T as b,a as T,b as n,c as a,d as N,e as s}from"./table-eMEisCI4.js";import{u as k,T as v,a as w}from"./useDebouncedSearch-B9qwQSuS.js";import{B as t}from"./button-B8ZzRKBh.js";import{E as y}from"./eye-BqZdNoK7.js";import{C}from"./Combination-DterT_Fn.js";import{X as A}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 J({pelatihanId:d}){i().props.auth.user;const{filters:m}=i().props,p=i().props.datatable,{data:l,links:x}=i().props.datatable,{params:o,setParams:h,setTimeDebounce:j}=k(route(`${route().current()}`,{id:d}),m),u=r=>{var f=window.confirm("Yakin ingin menolak tugas ini?");f==!0&&c.post(route("admin.pelatihan.tugas.reject",{id:r}))},g=r=>{c.post(route("admin.pelatihan.tugas.approve",{id:r}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(v,{placeholder:"Cari tugas",search:o.search,params:o,setParams:h,setTimeDebounce:j}),e.jsx("div",{className:"",children:e.jsxs(b,{children:[e.jsx(T,{children:e.jsxs(n,{children:[e.jsx(a,{children:"NIK"}),e.jsx(a,{children:"Nama"}),e.jsx(a,{children:"Tugas"}),e.jsx(a,{children:"Tanggal Akhir"}),e.jsx(a,{children:"Status"}),e.jsx(a,{children:"Action"})]})}),e.jsx(N,{children:l.length>0?l.map(r=>e.jsxs(n,{className:"bg-white",children:[e.jsx(s,{children:r.user.peserta.nik}),e.jsx(s,{children:r.user.peserta.nama_lengkap}),e.jsx(s,{children:r.materi_tugas.name}),e.jsx(s,{children:r.materi_tugas.due_date}),e.jsx(s,{children:r.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"}):r.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(s,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:r.file?route("storage.file",{path:r.file}):r.link,target:"_blank",children:e.jsx(t,{variant:"outline",children:e.jsx(y,{className:"w-4 h-4 text-blue-500"})})}),e.jsx(t,{variant:"outline",onClick:()=>g(r.id),children:e.jsx(C,{className:"w-4 h-4 text-green-500"})}),e.jsx(t,{variant:"destructive",onClick:()=>u(r.id),children:e.jsx(A,{className:"w-4 h-4 text-white"})})]})})]},r.id)):e.jsx(n,{children:e.jsx(s,{colSpan:6,className:"h-24 text-center bg-white",children:"No results found."})})})]})}),e.jsx(w,{links:x,meta:p})]})}export{J as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]