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/Edit-DARhwd6j.js

import{X as S,G as w,r as g,j as e,S as I}from"./app-B1Sg3jAd.js";import{A as U}from"./AdminLayout-CGe65nX_.js";import{B as F}from"./button-stRSEY7v.js";import{C as L,a as T,b as P,c as k}from"./card-BVdfvLdk.js";import{I as u}from"./input-sp4hCfE7.js";import{L as r}from"./label-DsOxagua.js";import{S as R,a as A,b as E,c as q,d as x}from"./select-D5UGtXgR.js";import{I as i}from"./InputError-CcNod6nZ.js";import{T as B}from"./textarea-DwhP5Kyj.js";import{I as X}from"./image-DPk4epjP.js";import{X as G}from"./x-COdlByhG.js";import"./index-C3qaiukN.js";import"./index-DlZYSKd5.js";import"./dropdown-menu-DTo9BBnB.js";import"./index-BoNucU06.js";import"./toaster-CbkrQzPo.js";import"./Combination-DwsDqJsx.js";import"./createLucideIcon-0gNxh7Fx.js";import"./index-UoedJaz0.js";import"./chevron-right-DAKbSkNP.js";import"./users-CSIL5xGU.js";import"./graduation-cap-DxDoQgI1.js";import"./clipboard-list-CuTdPupk.js";import"./scroll-DQuWNsCT.js";import"./index-CF44vzwl.js";function he({pendaftaran:t}){const v=S().props.auth.user,{data:n,setData:c,post:b,errors:l}=w({title:t.title,startDate:t.start_date,endDate:t.end_date,description:t.description,thumbnail:null,level:t.level}),[p,j]=g.useState(""),o=g.useRef(null),f=s=>{s.preventDefault(),b(route("admin.pendaftaran.update",{id:t.id}),{onFinish:()=>console.log("okoc")})},d=s=>{const{name:a,value:m}=s.target;c(h=>({...h,[a]:m}))},N=s=>{c(a=>({...a,level:s}))},y=s=>{var m;const a=(m=s.target.files)==null?void 0:m[0];if(a){c(D=>({...D,thumbnail:a}));const h=URL.createObjectURL(a);j(h)}},C=()=>{c(s=>({...s,thumbnail:null})),j(""),o.current&&(o.current.value="")};return e.jsxs(U,{user:v,header:e.jsx("h2",{className:"text-xl font-semibold leading-tight text-gray-800",children:"Ubah Pendaftaran"}),children:[e.jsx(I,{title:"Ubah Pendaftaran"}),e.jsx("div",{className:"flex items-center justify-between mb-2",children:e.jsx("h1",{className:"text-lg font-bold md:text-2xl",children:"Ubah Pendaftaran"})}),e.jsxs(L,{className:"w-full mx-auto",children:[e.jsx(T,{children:e.jsx(P,{children:"Ubah Pendaftaran"})}),e.jsx(k,{children:e.jsxs("form",{onSubmit:f,className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"title",children:"Judul"}),e.jsx(u,{id:"title",name:"title",value:n.title,onChange:d,required:!0}),e.jsx(i,{message:l.title,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"description",children:"Deskripsi"}),e.jsx(B,{id:"description",name:"description",value:n.description,onChange:d,className:"min-h-[200px]"}),e.jsx(i,{message:l.description,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"level",children:"Level"}),e.jsxs(R,{value:n.level,onValueChange:N,children:[e.jsx(A,{children:e.jsx(E,{placeholder:"Select level"})}),e.jsxs(q,{children:[e.jsx(x,{value:"beginner",children:"Beginner"}),e.jsx(x,{value:"intermediate",children:"Intermediate"}),e.jsx(x,{value:"advanced",children:"Advanced"})]})]}),e.jsx(i,{message:l.level,className:"mt-2"})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"startDate",children:"Tanggal Mulai"}),e.jsx(u,{id:"startDate",name:"startDate",type:"date",value:n.startDate,onChange:d,required:!0}),e.jsx(i,{message:l.startDate,className:"mt-2"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"endDate",children:"Tanggal Akhir"}),e.jsx(u,{id:"endDate",name:"endDate",type:"date",value:n.endDate,onChange:d,required:!0}),e.jsx(i,{message:l.endDate,className:"mt-2"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{children:"Gambar Thumbnail"}),e.jsxs("div",{className:"border-2 border-dashed rounded-lg p-4 hover:bg-gray-50 transition-colors",children:[e.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:y,className:"hidden",id:"thumbnail-upload"}),p?e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:p,alt:"Preview",className:"w-48 h-48 object-cover rounded-md mx-auto"}),e.jsx("button",{type:"button",onClick:C,className:"absolute top-2 right-2 p-1 bg-white rounded-full shadow-lg hover:bg-gray-100",children:e.jsx(G,{className:"w-4 h-4"})})]}):e.jsxs("label",{htmlFor:"thumbnail-upload",className:"flex flex-col items-center justify-center h-48 cursor-pointer",children:[e.jsx(X,{className:"w-12 h-12 text-gray-400"}),e.jsx("span",{className:"mt-2 text-sm text-gray-500",children:"Click to upload image"})]}),e.jsx(i,{message:l.thumbnail,className:"mt-2"})]})]}),e.jsx(F,{type:"submit",className:"w-full mt-4",children:"Ubah"})]})]})})]})]})}export{he as default};

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