Anons79 Mini Shell

Directory : /home/aplikasiposinfo/public_html/talent.gosepakat.id/public/build/assets/
Upload File :
Current File : /home/aplikasiposinfo/public_html/talent.gosepakat.id/public/build/assets/Detail-D55Lt2wE.js

import{X as B,r as t,j as e,S as H,x as w,A as F}from"./app-BXD2B5eP.js";import{A as M}from"./AdminLayout-DPnbrU6R.js";import O from"./DetailDataTable-DxXrdCD-.js";import{C as K,a as R,b as U,c as Q}from"./card-CbIQGTG-.js";import{B as r}from"./button-DylKzUXj.js";import{D as z,a as J,b as X,c as q,d as G,e as V}from"./dialog-ppifexEi.js";import{T as W,a as Y,b as f,c as h,d as Z,e as m}from"./table-Cnnj1fhq.js";import{C as ee}from"./checkbox-Dkod5T6h.js";import{I as se}from"./input-BlPRfX7R.js";import{F as ae}from"./file-down-CFau1h48.js";import{S as te}from"./scroll-Drc4LfeM.js";import{C}from"./circle-plus-D4Y3SC8x.js";import{C as re}from"./calendar-BwgzT4Ea.js";import{M as ie}from"./map-pin-1Cxfo1UT.js";import{U as le}from"./user-BKMcfAwm.js";import{B as N}from"./book-open-Ddz5fIuS.js";import{D as ne}from"./download-Ct5EnTxA.js";import{C as de}from"./clock-C-Z4VMau.js";import{S as ce}from"./search-B46dML8n.js";import"./index-Bth_M-wI.js";import"./index-CX9bDgWD.js";import"./dropdown-menu-CT8ek2jp.js";import"./index-jdRYo6ia.js";import"./toaster--0lha4Fi.js";import"./x-E5HdCfD7.js";import"./createLucideIcon-CV8Pe8Ty.js";import"./Combination-D0I-hRqe.js";import"./index-BvPdTlb4.js";import"./chevron-right-CSbLWkIe.js";import"./users-B6Ef6P-m.js";import"./graduation-cap-C_YDrRI7.js";import"./clipboard-list-CblFUnuG.js";import"./useSorting-DuAgFB74.js";import"./useDebouncedSearch-D7XQ3iK_.js";import"./chevron-left-C5LKv7uZ.js";import"./select-jdtgzfcY.js";import"./index-ciChaCGM.js";import"./eye-Dwycm-bx.js";import"./printer-CT7fjqa0.js";import"./badge-check-8RhG-F31.js";function es({pelatihan:a,peserta:me}){const b=B().props.auth.user,[S,x]=t.useState(!1),[g,y]=t.useState([]),[xe,k]=t.useState([]),[c,D]=t.useState(""),[u,T]=t.useState([]),[v,P]=t.useState(!1),[i,_]=t.useState(1),[l,oe]=t.useState(10),[j,$]=t.useState(0),o=async(s=1,n=10)=>{try{const d=`${route("admin.pelatihan.available-peserta",{id:a.id})}?page=${s}&per_page=${n}${c?`&search=${encodeURIComponent(c)}`:""}`,p=await(await fetch(d)).json();k(p.data||[]),T(p.data||[]),$(p.total||0),_(p.current_page||1)}catch(d){console.error("Error fetching available peserta:",d)}};t.useEffect(()=>{if(c){const s=setTimeout(()=>{o(i,l)},500);return()=>clearTimeout(s)}else o(i,l)},[c]);const I=()=>{o(i,l),x(!0)},A=s=>{y(n=>n.includes(s)?n.filter(d=>d!==s):[...n,s])},L=()=>{g.length>0?(P(!0),F.post(route("admin.pelatihan.add-peserta",{id:a.id}),{peserta_ids:g},{onSuccess:()=>{x(!1),y([])},onFinish:()=>{P(!1)}})):x(!1)},E=s=>{switch(s){case"beginner":return"bg-green-100 text-green-800";case"intermediate":return"bg-yellow-100 text-yellow-800";case"advanced":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};return e.jsxs(M,{user:b,children:[e.jsx(H,{title:"Pelatihan"}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h1",{className:"text-lg font-bold md:text-2xl",children:"Detail Pelatihan"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("a",{href:route("admin.pelatihan.export-peserta",{id:a.id}),target:"_blank",children:e.jsxs(r,{children:[e.jsx(ae,{className:"w-4 h-4"})," Export Peserta"]})}),e.jsx("a",{href:route("admin.pelatihan.print-sertifikat",{id:a.id}),target:"_blank",children:e.jsxs(r,{children:[e.jsx(te,{className:"w-4 h-4 "})," Print Sertifikat"]})}),b.role=="admin"&&e.jsx(w,{href:route("admin.pelatihan.edit",{id:a.id}),children:e.jsxs(r,{children:[e.jsx(C,{})," Edit Pelatihan"]})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-white rounded-lg shadow overflow-hidden",children:[e.jsx("div",{className:"p-6 border-b border-gray-200",children:e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:a.title}),e.jsx("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium ${E(a.level)} capitalize`,children:a.level})]}),e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${a.status?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:a.status?"Active":"Inactive"})})]})}),e.jsxs("div",{className:"p-6 grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(re,{className:"w-5 h-5 text-gray-400 mt-1"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500",children:"Durasi"}),e.jsxs("p",{className:"text-base text-gray-900",children:[new Date(a.start_date).toLocaleDateString()," - ",new Date(a.end_date).toLocaleDateString()]})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(ie,{className:"w-5 h-5 text-gray-400 mt-1"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500",children:"Lokasi"}),e.jsxs("p",{className:"text-base text-gray-900",children:[a.province.name,", ",a.regency.name]})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(le,{className:"w-5 h-5 text-gray-400 mt-1"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-500",children:"Instruktur"}),e.jsx("p",{className:"text-base text-gray-900",children:a.instructor.nama})]})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Deskripsi"}),e.jsx("p",{className:"text-gray-600",children:a.description}),e.jsx("div",{children:e.jsx("img",{src:`${route("storage.images")}?path=${a.thumbnail}`,alt:"Thumbnail",className:"w-full rounded-lg"})})]})]}),e.jsxs("div",{className:"p-6 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(N,{className:"w-5 h-5 text-gray-400"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Materi"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:a.pelatihan_materis.map(s=>e.jsxs("div",{className:"border rounded-lg p-4 flex justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-gray-900",children:s.name}),e.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Kode: ",s.code]}),e.jsx("p",{className:"text-sm text-gray-600 mt-2",children:s.description})]}),e.jsx("div",{children:e.jsx("a",{href:`${route("storage.file")}?path=${s.file}`,target:"_blank",children:e.jsx(ne,{className:"w-5 h-5 text-gray-400"})})})]},s.id))})]}),e.jsxs("div",{className:"p-6 border-t border-gray-200",children:[e.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[e.jsx(de,{className:"w-5 h-5 text-gray-400"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Jadwal"})]}),e.jsx("div",{className:"space-y-4",children:a.pelatihan_jadwals.map(s=>e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-gray-900",children:s.name}),e.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Kode: ",s.code]})]}),e.jsxs("div",{className:"text-end",children:[e.jsx("p",{className:"text-sm text-gray-500",children:new Date(s.course_date).toLocaleDateString()}),e.jsx("a",{href:route("admin.pelatihan.absensi",{pelatihan_jadwal_id:s.id}),children:e.jsxs(r,{children:[e.jsx(N,{})," Absensi"]})})]})]}),e.jsx("p",{className:"text-sm text-gray-600 mt-2",children:s.description})]},s.id))})]})]}),e.jsxs(K,{children:[e.jsx(R,{children:e.jsx(U,{children:e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h1",{className:"text-lg font-bold md:text-2xl",children:"Peserta Pelatihan"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(r,{onClick:I,children:[e.jsx(C,{})," Tambah Peserta"]}),e.jsx(w,{href:route("admin.pelatihan.tugas",{id:a.id}),children:e.jsxs(r,{children:[e.jsx(N,{})," Tugas Peserta"]})})]})]})})}),e.jsx(Q,{children:e.jsx(O,{pelatihanId:a.id})})]})]}),e.jsx(z,{open:S,onOpenChange:x,children:e.jsxs(J,{className:"max-w-4xl",children:[e.jsxs(X,{children:[e.jsx(q,{children:"Tambah Peserta Pelatihan"}),e.jsx(G,{children:"Pilih peserta yang ingin ditambahkan ke pelatihan ini."})]}),e.jsxs("div",{className:"flex items-center space-x-2 my-4",children:[e.jsx(ce,{className:"w-4 h-4 text-gray-400"}),e.jsx(se,{type:"text",placeholder:"Cari peserta berdasarkan nama, NIK, email, atau no. HP",value:c,onChange:s=>D(s.target.value),className:"flex-1"})]}),e.jsx("div",{className:"max-h-[60vh] overflow-y-auto",children:e.jsxs(W,{children:[e.jsx(Y,{children:e.jsxs(f,{children:[e.jsx(h,{className:"w-12",children:"Pilih"}),e.jsx(h,{children:"NIK"}),e.jsx(h,{children:"Nama"}),e.jsx(h,{children:"Email"}),e.jsx(h,{children:"No. HP"})]})}),e.jsx(Z,{children:u&&u.length>0?u.map(s=>{var n,d;return e.jsxs(f,{children:[e.jsx(m,{children:e.jsx(ee,{checked:g.includes(s.id),onCheckedChange:()=>A(s.id)})}),e.jsx(m,{children:s.nik||"-"}),e.jsx(m,{children:s.nama_lengkap||((n=s.user)==null?void 0:n.nama)}),e.jsx(m,{children:s.email||((d=s.user)==null?void 0:d.email)}),e.jsx(m,{children:s.no_hp||"-"})]},s.id)}):e.jsx(f,{children:e.jsx(m,{colSpan:5,className:"h-24 text-center",children:c?"Tidak ada peserta yang sesuai dengan pencarian.":"Tidak ada peserta yang tersedia."})})})]})}),e.jsxs(V,{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx("div",{children:j>0&&e.jsxs("p",{className:"text-sm text-gray-500",children:["Menampilkan ",(i-1)*l+1," - ",Math.min(i*l,j)," dari ",j," peserta"]})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(r,{variant:"outline",onClick:()=>o(i-1,l),disabled:i<=1,children:"Sebelumnya"}),e.jsx(r,{variant:"outline",onClick:()=>o(i+1,l),disabled:i*l>=j,children:"Selanjutnya"})]})]}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(r,{variant:"outline",onClick:()=>x(!1),children:"Batal"}),e.jsx(r,{onClick:L,disabled:v,children:v?"Loading...":"Simpan"})]})]})]})})]})}export{es as default};

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]