import{X as f,G as g,j as e,S as b}from"./app-Bm5W8873.js";import{A as k}from"./AdminLayout-9oPvjd7S.js";import{C as w,a as N,b as v,c as C}from"./card-UPTyxnuw.js";import{S}from"./switch-C1igX9_4.js";import{L as i}from"./label-Br3Ar4zt.js";import{I as d}from"./input-BbASCKvU.js";import{I as n}from"./InputError-B5ETbk7m.js";import{B as c}from"./button-BpMXVHfy.js";import{S as _,a as y,b as I,c as D,d as p}from"./select-DFJfktKK.js";import{D as P}from"./download-D4wQoQo-.js";import{L as T}from"./loader-circle-u9vVfSLj.js";import"./utils-CytzSlOG.js";import"./dropdown-menu-iqJYazRp.js";import"./index-CQuRJj67.js";import"./toaster-CJG_sCkE.js";import"./x-BsFs6T37.js";import"./createLucideIcon-C73-faUc.js";import"./Combination-D_Dsj4kt.js";import"./index-DoLAoYnB.js";import"./chevron-right-Cgohyo97.js";import"./users-Aw6uBSZr.js";import"./graduation-cap-C8LgiP1O.js";import"./index-DTKIRgu_.js";function se(){const u=f().props.auth.user,{data:r,setData:t,post:h,processing:o,errors:l}=g({file:null,tahun:"2025",buat_akun:0,password_kustom:null}),x=s=>{s.preventDefault(),h(route("admin.peserta.import"))},j=s=>{var m;const a=(m=s.target.files)==null?void 0:m[0];if(a&&!a.name.endsWith(".xlsx")&&!a.name.endsWith(".xls")){t("file",null);return}a&&t("file",a)};return e.jsxs(k,{user:u,header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Import Peserta"}),children:[e.jsx(b,{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(c,{children:[e.jsx(P,{})," Download Template"]})})]}),e.jsxs(w,{className:"w-full mx-auto",children:[e.jsx(N,{children:e.jsx(v,{children:"Import Peserta"})}),e.jsx(C,{children:e.jsxs("form",{onSubmit:x,method:"POST",encType:"multipart/form-data",className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"tahun",children:"Tahun Data"}),e.jsxs(_,{onValueChange:()=>{t("tahun",r.tahun)},defaultValue:r.tahun,children:[e.jsx(y,{children:e.jsx(I,{placeholder:"Pilih Tahun Data"})}),e.jsxs(D,{children:[e.jsx(p,{value:"2025",children:"2025"}),e.jsx(p,{value:"2024",children:"2024"})]})]})]}),e.jsx(n,{message:l.tahun})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx(i,{htmlFor:"file",children:"File Excel"}),e.jsx(d,{id:"file",type:"file",name:"file",accept:".xlsx, .xls",onChange:j,className:"mt-1 block w-full"}),e.jsx(n,{message:l.file})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(S,{id:"buat_akun",checked:r.buat_akun===1,onCheckedChange:s=>t(a=>({...a,buat_akun:s?1:0}))}),e.jsx(i,{htmlFor:"buat_akun",children:"Buat Akun Otomatis"})]}),e.jsx(n,{message:l.buat_akun})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx(i,{htmlFor:"file",children:"Password Kustom (Kosongkan jika ingin generate password otomatis untuk setiap akun peserta) "}),e.jsx(d,{disabled:r.buat_akun===0,id:"password_kustom",type:"password",name:"password_kustom",onChange:s=>t("password_kustom",s.target.value),className:"mt-1 block w-full"}),e.jsx(n,{message:l.file})]})}),e.jsx("div",{className:"mt-4",children:e.jsxs(c,{type:"submit",disabled:o,children:[o?e.jsx(T,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Import"]})})]})})]})]})}export{se as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]