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/Absensi--EMq37c0.js

import{r as c,X as h,j as e,S as p,A as u}from"./app-DBaRwdrV.js";import{C as f}from"./checkbox-DynOeP16.js";import{A as g}from"./AdminLayout-DdONHG5n.js";import{B as N}from"./button-7k3wDpxX.js";import{U as j}from"./users-DbUsFE-j.js";import{P as b}from"./printer-BeYsUkjd.js";import{c as l}from"./createLucideIcon-B3t58pJo.js";import{C as y}from"./Combination-BIyoqpAt.js";import"./index-w8eecHIR.js";import"./index-ZXv2nGYb.js";import"./index-BlTV345J.js";import"./index-DIKLyIvN.js";import"./index-Crpd4T8B.js";import"./toaster-Cnpe6MbZ.js";import"./x-B-qsThC2.js";import"./dropdown-menu-CkeMwoJL.js";import"./chevron-right-vGTUS8j1.js";import"./graduation-cap-DX4TRYRh.js";/**
 * @license lucide-react v0.474.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],k=l("CircleCheck",v);/**
 * @license lucide-react v0.474.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],C=l("CircleX",w);function G({jadwal:s}){const[i,d]=c.useState(s.pelatihan.pesertas),m=t=>{d(i.map(r=>r.id===t?{...r,hadir:!r.hadir}:r))};c.useEffect(()=>{for(let t=0;t<s.pelatihan.pesertas.length;t++){const r=s.pelatihan.pesertas[t];s.absen_pesertas.find(a=>a.peserta_id==r.id&&a.hadir==!0)&&(r.hadir=!0,i.map(a=>a.id===r.id?{...r,hadir:!0}:a))}d(i)},[]);const o=()=>{u.post(route("admin.pelatihan.simpan-absensi",{pelatihan_jadwal_id:s.id}),{absensi:i.map(t=>({id:t.id,hadir:t.hadir}))})},n=i.filter(t=>t.hadir).length,x=h().props.auth.user;return e.jsxs(g,{user:x,header:e.jsxs("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:["Absensi Peserta Pelatihan : ",s.pelatihan.title]}),children:[e.jsx(p,{title:`Absensi Pelatihan ${s.pelatihan.title}`}),e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsxs("h1",{className:"text-lg font-bold md:text-2xl",children:["Absensi Peserta Pelatihan : ",s.pelatihan.title]})}),e.jsxs("div",{className:"bg-card rounded-lg shadow-lg overflow-hidden border",children:[e.jsx("div",{className:"p-6 bg-primary",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx(j,{className:"w-8 h-8 text-primary-foreground"}),e.jsxs("div",{className:"text-primary-foreground",children:[e.jsx("h1",{className:"text-2xl font-bold ",children:"Ceklist Kehadiran"}),e.jsxs("p",{children:[s.name," / ",s.course_date]})]})]}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxs("div",{className:"text-primary-foreground bg-primary/80 px-4 py-2 rounded-full text-sm font-medium",children:["Hadir: ",n," / ",i.length]}),e.jsxs("a",{href:`${route("admin.pelatihan.absensi.print",s.id)}`,target:"_blank",className:"no-print flex items-center space-x-2 bg-primary-foreground text-primary px-4 py-2 rounded-full text-sm font-medium hover:bg-primary-foreground/90 transition-colors",children:[e.jsx(b,{className:"w-4 h-4"}),e.jsx("span",{children:"Print"})]})]})]})}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{className:"bg-muted",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",style:{width:"100px"},children:"No."}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Peserta"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider no-print",children:"Hadir"}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-muted-foreground uppercase tracking-wider",style:{width:"200px"},children:"Status"})]})}),e.jsx("tbody",{className:"bg-card divide-y divide-border",children:i.map((t,r)=>e.jsxs("tr",{className:"hover:bg-muted/50 transition-colors",children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-muted-foreground",children:r+1}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm font-medium text-card-foreground",children:t.nama_lengkap})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap no-print",children:e.jsx(f,{checked:t.hadir,onCheckedChange:()=>m(t.id)})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center",children:t.hadir?e.jsxs("span",{className:"flex items-center text-green-600 font-medium",children:[e.jsx(k,{className:"w-4 h-4 mr-1"}),"Hadir"]}):e.jsxs("span",{className:"flex items-center text-destructive font-medium",children:[e.jsx(C,{className:"w-4 h-4 mr-1"}),"Tidak Hadir"]})})})]},t.id))})]})}),e.jsxs("div",{className:"p-4 bg-muted/50 border-t flex gap-2 items-center",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Total Peserta: ",i.length," | Hadir: ",n," | Absent: ",i.length-n]}),e.jsxs(N,{variant:"outline",onClick:o,className:"no-print",children:[e.jsx(y,{className:"w-4 h-4 text-green-500"})," Simpan"]})]})]})]})}export{G as default};

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