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/Import-vOzQWG8G.js

import{X as S,r as t,G as w,j as e,S as C}from"./app-BXD2B5eP.js";import{A as _}from"./AdminLayout-DPnbrU6R.js";import{C as E,a as F,b as I,c as P}from"./card-CbIQGTG-.js";import{S as D}from"./switch-3OOtfK7g.js";import{L as n}from"./label-DmUKaOBW.js";import{I as f}from"./input-BlPRfX7R.js";import{I as c}from"./InputError-BzpvKLo3.js";import{B as j}from"./button-DylKzUXj.js";import{S as T,a as L,b as A,c as B,d as g}from"./select-jdtgzfcY.js";import{p as K}from"./excelUtils-ConAkEWV.js";import{D as V}from"./download-Ct5EnTxA.js";import{L as O}from"./loader-circle-9vy91IuF.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"./scroll-Drc4LfeM.js";import"./index-ciChaCGM.js";import"./xlsx-BBWTpfDg.js";function je(){const b=S().props.auth.user,[m,d]=t.useState(null),[Q,p]=t.useState(!1),[W,u]=t.useState(null),[G,k]=t.useState(""),{data:l,setData:r,post:y,processing:h,errors:i}=w({file:null,tahun:"2025",buat_akun:0,password_kustom:null}),N=s=>{s.preventDefault(),y(route("admin.peserta.import"))},v=async s=>{var x;const a=(x=s.target.files)==null?void 0:x[0];if(a&&!a.name.endsWith(".xlsx")&&!a.name.endsWith(".xls")){r("file",null);return}if(a){r("file",a),p(!0),u(null),console.log("excel");try{const o=await K(a);console.log(o),d(o)}catch(o){console.error("Error parsing Excel file:",o),u("Failed to parse Excel file. Please ensure it is a valid Excel format.")}finally{p(!1)}}};return t.useCallback(s=>{m&&d({...m,activeSheet:s})},[m]),t.useCallback(s=>{k(s)},[]),t.useCallback(()=>{},[]),e.jsxs(_,{user:b,header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Import Peserta"}),children:[e.jsx(C,{title:"Import Peserta"}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h1",{className:"text-lg font-bold md:text-2xl",children:"Import Peserta"}),e.jsx("a",{href:route("admin.peserta.download-template-import"),target:"_blank",children:e.jsxs(j,{children:[e.jsx(V,{})," Download Template"]})})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs(E,{className:"w-full mx-auto",children:[e.jsx(F,{children:e.jsx(I,{children:"Import Peserta"})}),e.jsx(P,{children:e.jsxs("form",{onSubmit:N,method:"POST",encType:"multipart/form-data",className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"tahun",children:"Tahun Data"}),e.jsxs(T,{onValueChange:()=>{r("tahun",l.tahun)},defaultValue:l.tahun,children:[e.jsx(L,{children:e.jsx(A,{placeholder:"Pilih Tahun Data"})}),e.jsxs(B,{children:[e.jsx(g,{value:"2025",children:"2025"}),e.jsx(g,{value:"2024",children:"2024"})]})]})]}),e.jsx(c,{message:i.tahun})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"file",children:"File Excel"}),e.jsx(f,{id:"file",type:"file",name:"file",accept:".xlsx, .xls",onChange:v,className:"mt-1 block w-full"})]}),e.jsx(c,{message:i.file})]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(D,{id:"buat_akun",checked:l.buat_akun===1,onCheckedChange:s=>r(a=>({...a,buat_akun:s?1:0}))}),e.jsx(n,{htmlFor:"buat_akun",children:"Buat Akun Otomatis"})]}),e.jsx(c,{message:i.buat_akun})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"file",children:"Password Kustom (Kosongkan jika ingin generate password otomatis untuk setiap akun peserta) "}),e.jsx(f,{disabled:l.buat_akun===0,id:"password_kustom",type:"password",name:"password_kustom",placeholder:"Password Kustom...",onChange:s=>r("password_kustom",s.target.value),className:"mt-1 block w-full"}),e.jsx(c,{message:i.file})]})]})}),e.jsx("div",{className:"mt-4",children:e.jsxs(j,{type:"submit",disabled:h,children:[h?e.jsx(O,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Import"]})})]})})]})})]})}export{je as default};

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