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-BmRj-3ku.js

import{X as S,G as w,r as g,j as e,S as I}from"./app-CxR6mXVP.js";import{A as U}from"./AdminLayout-Br3kxU_M.js";import{B as F}from"./button-DpQP_lYd.js";import{C as L,a as T,b as P,c as k}from"./card-BUSXAYMi.js";import{I as u}from"./input-CsuTifve.js";import{L as r}from"./label-EP1vquW8.js";import{S as R,a as A,b as E,c as q,d as x}from"./select-Bm0HKOqe.js";import{I as i}from"./InputError-mdZGzeRq.js";import{T as B}from"./textarea-9kORoRFn.js";import{I as X}from"./image-EXBTnplt.js";import{X as G}from"./x-BTmWAVnY.js";import"./utils-CytzSlOG.js";import"./dropdown-menu-DSA7ILHF.js";import"./index-BzpbaWHn.js";import"./index-Dy7KKS3_.js";import"./index-C6J07-3_.js";import"./toaster-TzmOCMaj.js";import"./Combination-BDsadoUX.js";import"./createLucideIcon-BX4VOWE3.js";import"./index-COEfcW-E.js";import"./chevron-right-DFpRS_H1.js";import"./users-BAS2Dmtn.js";import"./graduation-cap-DfxWJKg6.js";import"./index-BWgL_1QM.js";function oe({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{oe as default};

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