import{r as d,S as u,j as e,a as p}from"./app-BZJf8lgN.js";import{L as x}from"./layout-DZ5xjWdd.js";import{I as h}from"./inputtext.esm-B1lZn37a.js";import{P as j,F as f}from"./fileupload.esm-CWt4e-Qk.js";import{C as g}from"./CustomCKEditor-BpmNiC9B.js";import{I as b}from"./InputLabel-Dd3VnoK3.js";import{I as y}from"./image.esm-DhzuK4QZ.js";import{T as N}from"./toast.esm-CYGIlaDH.js";import{B as E}from"./button.esm-D_cwsnQR.js";import"./hooks.esm-UVLztt_0.js";import"./CSSTransition-DBuKQJwM.js";import"./index.esm-Ckth6fI3.js";import"./index.esm-hRnQzR_k.js";import"./csstransition.esm-BNRxTMOa.js";import"./index.esm-CygY3Qsw.js";import"./index.esm-B5zYYMSp.js";const A=({productos:a})=>{const r=d.useRef(null),{data:i,setData:s,post:l,processing:o,reset:m}=u({titulo:a.titulo,texto:a.texto,imagenFile:null}),c=t=>{a.imagen=t.files[0].objectURL,s("imagenFile",t.files[0])},n=t=>{t.preventDefault(),l(route("productos.update",{_method:"put"}),{onSuccess:()=>{r.current.show({severity:"success",summary:"Exito",detail:"Contenido Actualizado",life:3e3}),m()}})};return e.jsxs(x,{children:[o&&e.jsxs(j,{value:o.percentage,max:"100",children:[o.percentage,"%"]}),e.jsx(p,{title:"Editar Productos"}),e.jsx("div",{className:"grid",children:e.jsx("div",{className:"col-12",children:e.jsxs("div",{className:"card",children:[e.jsx(N,{ref:r}),e.jsxs("section",{className:"max-w-xl",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Editar Productos"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Editar Contenido del Productos."})]}),e.jsxs("form",{className:"mt-4 space-y-6",onSubmit:n,encType:"multipart/form-data",children:[e.jsx(h,{id:"title",name:"title",placeholder:"Titulo",className:"w-full mb-4",value:i.titulo,onChange:t=>s("titulo",t.target.value)}),e.jsx(g,{data:i.texto||"",onChange:t=>s("texto",t),placeholder:"Escribe aquí..."}),e.jsx(y,{src:a.imagen}),e.jsx(f,{mode:"basic",name:"img",className:"mt-3",accept:"image/*",chooseLabel:"Subir Imagen",onSelect:c}),e.jsx(b,{children:"Resolucion recomendada 551px * 404px"}),e.jsx(E,{className:"mt-5",style:{display:"block",margin:"auto"},type:"submit",children:"Modificar"})]})]})]})})})]})};export{A as default};
//# sourceMappingURL=Productos-CUpKwTgv.js.map
