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-BV-IE_8y.js

import{r as o,j as e,X as D,S as L,A as X}from"./app-DXWVueIA.js";import{u as K,a as O,c as T,P as E,b as P}from"./index-CQlsUeGi.js";import{u as $}from"./index-D1H8MGCT.js";import{u as q}from"./index-C52FfLa6.js";import{P as U}from"./toaster-DNzonLS1.js";import{c as _}from"./utils-CytzSlOG.js";import{C as R,B as F}from"./Combination-BUcIGg2i.js";import{A as V}from"./AdminLayout-CmIDVTZr.js";import{U as G}from"./users-B50-5rbL.js";import{c as j}from"./createLucideIcon-Dc4LRknQ.js";import"./index-DK9k7neE.js";import"./x-BLpcvNvx.js";import"./dropdown-menu-QRO3Xf-H.js";import"./chevron-right-Be3sB-hW.js";import"./graduation-cap-C4cfNWpP.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 J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q=j("CircleCheck",J);/**
 * @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"}]],Y=j("CircleX",W);/**
 * @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 Z=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],ee=j("Printer",Z);var C="Checkbox",[te,ve]=T(C),[se,re]=te(C),S=o.forwardRef((t,r)=>{const{__scopeCheckbox:a,name:h,checked:u,defaultChecked:i,required:d,disabled:l,value:s="on",onCheckedChange:n,form:f,...m}=t,[x,g]=o.useState(null),k=K(r,c=>g(c)),v=o.useRef(!1),w=x?f||!!x.closest("form"):!0,[b=!1,N]=O({prop:u,defaultProp:i,onChange:n}),B=o.useRef(b);return o.useEffect(()=>{const c=x==null?void 0:x.form;if(c){const y=()=>N(B.current);return c.addEventListener("reset",y),()=>c.removeEventListener("reset",y)}},[x,N]),e.jsxs(se,{scope:a,state:b,disabled:l,children:[e.jsx(E.button,{type:"button",role:"checkbox","aria-checked":p(b)?"mixed":b,"aria-required":d,"data-state":H(b),"data-disabled":l?"":void 0,disabled:l,value:s,...m,ref:k,onKeyDown:P(t.onKeyDown,c=>{c.key==="Enter"&&c.preventDefault()}),onClick:P(t.onClick,c=>{N(y=>p(y)?!0:!y),w&&(v.current=c.isPropagationStopped(),v.current||c.stopPropagation())})}),w&&e.jsx(ae,{control:x,bubbles:!v.current,name:h,value:s,checked:b,required:d,disabled:l,form:f,style:{transform:"translateX(-100%)"},defaultChecked:p(i)?!1:i})]})});S.displayName=C;var A="CheckboxIndicator",I=o.forwardRef((t,r)=>{const{__scopeCheckbox:a,forceMount:h,...u}=t,i=re(A,a);return e.jsx(U,{present:h||p(i.state)||i.state===!0,children:e.jsx(E.span,{"data-state":H(i.state),"data-disabled":i.disabled?"":void 0,...u,ref:r,style:{pointerEvents:"none",...t.style}})})});I.displayName=A;var ae=t=>{const{control:r,checked:a,bubbles:h=!0,defaultChecked:u,...i}=t,d=o.useRef(null),l=$(a),s=q(r);o.useEffect(()=>{const f=d.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(l!==a&&g){const k=new Event("click",{bubbles:h});f.indeterminate=p(a),g.call(f,p(a)?!1:a),f.dispatchEvent(k)}},[l,a,h]);const n=o.useRef(p(a)?!1:a);return e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:u??n.current,...i,tabIndex:-1,ref:d,style:{...t.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function p(t){return t==="indeterminate"}function H(t){return p(t)?"indeterminate":t?"checked":"unchecked"}var M=S,ne=I;const z=o.forwardRef(({className:t,...r},a)=>e.jsx(M,{ref:a,className:_("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...r,children:e.jsx(ne,{className:_("flex items-center justify-center text-current"),children:e.jsx(R,{className:"h-4 w-4"})})}));z.displayName=M.displayName;function Ne({jadwal:t}){const[r,a]=o.useState(t.pelatihan.pesertas),h=s=>{a(r.map(n=>n.id===s?{...n,hadir:!n.hadir}:n))};o.useEffect(()=>{for(let s=0;s<t.pelatihan.pesertas.length;s++){const n=t.pelatihan.pesertas[s];t.absen_pesertas.find(m=>m.peserta_id==n.peserta.id&&m.hadir==!0)&&(n.hadir=!0,r.map(m=>m.id===n.id?{...n,hadir:!0}:m))}a(r)},[]);const u=()=>{X.post(route("admin.pelatihan.simpan-absensi",{pelatihan_jadwal_id:t.id}),{absensi:r.map(s=>({id:s.peserta.id,hadir:s.hadir}))})},i=()=>{window.print()},d=r.filter(s=>s.hadir).length,l=D().props.auth.user;return e.jsxs(V,{user:l,header:e.jsxs("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:["Absensi Peserta Pelatihan : ",t.pelatihan.title]}),children:[e.jsx(L,{title:`Absensi Pelatihan ${t.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 : ",t.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(G,{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:[t.name," / ",t.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: ",d," / ",r.length]}),e.jsxs("button",{onClick:i,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(ee,{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:r.map((s,n)=>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:n+1}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"text-sm font-medium text-card-foreground",children:s.peserta.nama_lengkap})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap no-print",children:e.jsx(z,{checked:s.hadir,onCheckedChange:()=>h(s.id)})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("div",{className:"flex items-center",children:s.hadir?e.jsxs("span",{className:"flex items-center text-green-600 font-medium",children:[e.jsx(Q,{className:"w-4 h-4 mr-1"}),"Hadir"]}):e.jsxs("span",{className:"flex items-center text-destructive font-medium",children:[e.jsx(Y,{className:"w-4 h-4 mr-1"}),"Tidak Hadir"]})})})]},s.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: ",r.length," | Hadir: ",d," | Absent: ",r.length-d]}),e.jsxs(F,{variant:"outline",onClick:u,className:"no-print",children:[e.jsx(R,{className:"w-4 h-4 text-green-500"})," Simpan"]})]})]})]})}export{Ne as default};

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