import{X as f,G as j,j as e,S as g}from"./app-DYk6xQX6.js";import{A as b}from"./AdminLayout-Dn6d7zoj.js";import{C,a as I,b as N,c as S}from"./card-CjA07Y1G.js";import{L as m}from"./label-C8BFDu1c.js";import{I as v}from"./input-BYG5sZqQ.js";import{I as n}from"./InputError-dBPtBpg_.js";import{B as d}from"./button-mzBB7AZE.js";import{S as y,a as w,b as D,c as T,d as c}from"./select-CviHxm2R.js";import{D as P}from"./download-DhCOGepT.js";import{L}from"./loader-circle-CdzXNhBF.js";import"./utils-CytzSlOG.js";import"./dropdown-menu-Dvr5OHHz.js";import"./index-CvzdLRF-.js";import"./toaster-Bx00etXj.js";import"./x-Dv-GsTNZ.js";import"./createLucideIcon-Dp-NL7SL.js";import"./Combination-ChDAM5zP.js";import"./index-C2eS3D7Q.js";import"./chevron-right-BKrlaPnY.js";import"./users-C8jdJUUu.js";import"./graduation-cap-DdcBQm8O.js";import"./index-r_SG9S4I.js";function $(){const p=f().props.auth.user,{data:r,setData:t,post:h,processing:l,errors:i}=j({file:null,tahun:"2025"}),x=a=>{a.preventDefault(),h(route("admin.peserta.import"))},u=a=>{var o;const s=(o=a.target.files)==null?void 0:o[0];if(s&&!s.name.endsWith(".xlsx")&&!s.name.endsWith(".xls")){t("file",null);return}s&&t("file",s)};return e.jsxs(b,{user:p,header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Import Peserta"}),children:[e.jsx(g,{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(d,{children:[e.jsx(P,{})," Download Template"]})})]}),e.jsxs(C,{className:"w-full mx-auto",children:[e.jsx(I,{children:e.jsx(N,{children:"Import Peserta"})}),e.jsx(S,{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(m,{htmlFor:"tahun",children:"Tahun Data"}),e.jsxs(y,{onValueChange:()=>{t("tahun",r.tahun)},defaultValue:r.tahun,children:[e.jsx(w,{children:e.jsx(D,{placeholder:"Pilih Tahun Data"})}),e.jsxs(T,{children:[e.jsx(c,{value:"2025",children:"2025"}),e.jsx(c,{value:"2024",children:"2024"})]})]})]}),e.jsx(n,{message:i.tahun})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.jsxs("div",{children:[e.jsx(m,{htmlFor:"file",children:"File Excel"}),e.jsx(v,{id:"file",type:"file",name:"file",accept:".xlsx, .xls",onChange:u,className:"mt-1 block w-full"}),e.jsx(n,{message:i.file})]})}),e.jsx("div",{className:"mt-4",children:e.jsxs(d,{type:"submit",disabled:l,children:[l?e.jsx(L,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Import"]})})]})})]})]})}export{$ as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]