1import{u as a,j as e,d as s}from"./app-CYNscnFw.js";import{A as i}from"./AdminLayout-C-LvtZfW.js";import"./music-2-bjHzdRfv.js";function t({penyiars:i,cabangList:t}){const{data:l,setData:n,post:d,processing:r,errors:m,reset:o}=a({nama_asli:i.nama_asli||"",nama_udara:i.nama_udara||"",foto:null,id_cabang:i.id_cabang||"",instagram:i.instagram||"",tiktok:i.tiktok||"",visibility:"boolean"==typeof i.visibility?i.visibility:Boolean(i.visibility)});return e.jsxs("div",{className:"rounded-2xl p-6",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-4",children:"Tambah Penyiar"}),e.jsxs("form",{onSubmit:a=>{a.preventDefault();const e=new FormData;e.append("_method","PUT"),e.append("nama_udara",l.nama_udara),e.append("nama_asli",l.nama_asli),e.append("id_cabang",l.id_cabang),e.append("tiktok",l.tiktok),e.append("instagram",l.instagram),l.foto&&e.append("foto",l.foto),e.append("visibility",l.visibility?1:0),s.post(route("penyiar.update",{penyiar:i.id_penyiar}),e,{forceFormData:!0,onSuccess:a=>{o("foto")},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 Asli"}),e.jsx("input",{type:"text",value:l.nama_asli,onChange:a=>n("nama_asli",a.target.value),className:"w-full border rounded-lg p-2"}),m.nama_asli&&e.jsx("div",{className:"text-red-500 text-sm",children:m.nama_asli})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"nama Udara"}),e.jsx("input",{type:"text",value:l.nama_udara,onChange:a=>n("nama_udara",a.target.value),className:"w-full border rounded-lg p-2"}),m.nama_udara&&e.jsx("div",{className:"text-red-500 text-sm",children:m.nama_udara})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"foto"}),e.jsx("input",{type:"file",onChange:a=>n("foto",a.target.files[0]),className:"w-full border rounded-lg p-2"}),m.foto&&e.jsx("div",{className:"text-red-500 text-sm",children:m.foto}),i.foto&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-sm text-gray-600",children:"foto saat ini:"}),e.jsx("img",{src:i.foto,alt:"Preview",className:"mt-1 w-40 rounded-lg shadow"})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"Cabang"}),e.jsxs("select",{value:l.id_cabang,onChange:a=>n("id_cabang",a.target.value),className:"w-full border rounded-lg p-2",children:[e.jsx("option",{value:"",children:"-- Pilih Programs --"}),t.map(a=>e.jsx("option",{value:a.id_cabang,children:a.nama_cabang},a.id_cabang))]}),m.id_cabang&&e.jsx("div",{className:"text-red-500 text-sm",children:m.id_cabang})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"instagram"}),e.jsx("input",{type:"text",value:l.instagram,onChange:a=>n("instagram",a.target.value),className:"w-full border rounded-lg p-2"}),m.instagram&&e.jsx("div",{className:"text-red-500 text-sm",children:m.instagram})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"tiktok"}),e.jsx("input",{type:"text",value:l.tiktok,onChange:a=>n("tiktok",a.target.value),className:"w-full border rounded-lg p-2"}),m.tiktok&&e.jsx("div",{className:"text-red-500 text-sm",children:m.tiktok})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block mb-1 font-medium",children:"Visibility"}),e.jsxs("select",{value:l.visibility,onChange:a=>n("visibility","true"===a.target.value),className:"w-full border rounded-lg p-2",children:[e.jsx("option",{value:"true",children:"Tampil"}),e.jsx("option",{value:"false",children:"Sembunyikan"})]}),m.visibility&&e.jsx("div",{className:"text-red-500 text-sm",children:m.visibility})]}),e.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[e.jsx("button",{type:"button",onClick:()=>window.location.href="/dashboard/penyiar",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:r,className:"bg-[#F9ED0D] text-black px-4 py-2 rounded-lg hover:bg-[#c8c256] disabled:opacity-50 ",children:r?"Menyimpan...":"Simpan"})]})]})]})}t.layout=a=>e.jsx(i,{menu:"penyiar/edit",children:a})
vendor: 23 bytes, line 1
1;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.