PageSourceSearch

https://ramafm.com/build/assets/editMajalah-B7GMV2nc.js

js ramafm.com collected 2026-10-08 23:08:17 UTC 2,782 bytes, 1 lines download raw bytes

1import{u as a,j as e,d as l}from"./app-CYNscnFw.js";import{A as s}from"./AdminLayout-C-LvtZfW.js";import"./music-2-bjHzdRfv.js";function t({majalah:s}){const{data:t,setData:i,post:m,processing:n,errors:r,reset:d}=a({nama_majalah:s.nama_majalah,gambar:null,tanggal:s.tanggal,visibility:s.visibility});return e.jsxs("div",{className:"rounded-2xl p-6",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Tambah Jumbotron"}),e.jsxs("form",{onSubmit:a=>{a.preventDefault();const e=new FormData;e.append("_method","PUT"),e.append("nama_majalah",t.nama_majalah),e.append("tanggal",t.tanggal),t.gambar&&e.append("gambar",t.gambar),e.append("visibility",t.visibility?1:0),l.post(route("majalah.update",{majalah:s.id_majalah}),e,{forceFormData:!0,onSuccess:a=>{d("gambar")},onError:a=>{}})},encType:"multipart/form-data",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"nama Majalah"}),e.jsx("input",{type:"text",value:t.nama_majalah,onChange:a=>i("nama_majalah",a.target.value),className:"w-full border rounded-lg p-2"}),r.nama_majalah&&e.jsx("div",{className:"text-red-500 text-sm",children:r.nama_majalah})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"Gambar"}),e.jsx("input",{type:"file",onChange:a=>i("gambar",a.target.files[0]),className:"w-full border rounded-lg p-2"}),r.gambar&&e.jsx("div",{className:"text-red-500 text-sm",children:r.gambar}),s.gambar&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"Gambar saat ini:"}),e.jsx("img",{src:s.gambar,alt:"Preview",className:"mt-1 w-40 rounded-lg shadow"})]})]}),e.jsx("input",{type:"date",value:t.tanggal,onChange:a=>i("tanggal",a.target.value),className:"border p-2 w-full"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"Visibility"}),e.jsxs("select",{value:t.visibility,onChange:a=>i("visibility","true"===a.target.value),className:"w-full border rounded-lg p-2",children:[e.jsx("option",{value:1,children:"Tampil"}),e.jsx("option",{value:0,children:"Sembunyikan"})]}),r.visibility&&e.jsx("div",{className:"text-red-500 text-sm",children:r.visibility})]}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[e.jsx("button",{type:"button",onClick:()=>window.location.href="/dashboard/majalah",className:"px-4 py-2 rounded-lg border border-gray-400 text-gray-700 hover:bg-gray-200 transition",children:"← Kembali"}),e.jsx("button",{type:"submit",disabled:n,className:"bg-[#F9ED0D] text-black px-4 py-2 rounded-lg hover:bg-[#c8c256] disabled:opacity-50 ",children:n?"Menyimpan...":"Simpan"})]})]})]})}t.layout=a=>e.jsx(s,{menu:"majalah/edit",children:a});export{t as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.