import{b4 as p,r as h,d as f,j as e,f as r,B as x,bR as b,m as j,y,ft as g,n as a}from"./index-7ecf457b.js";const A=s=>{const{iPrId:d,source:t}=s;p(),h.useState({});const n={dominio:"",label:"Documento",name:"",tabla:"adjtip",id:"AdjTipId",type:"supercombobox",text:"AdjTipNom",where:"",whereAdicion:"",otrosCampos:"AdjTipVinc , AdjTipId",groupBy:"",ordenBy:""},{control:i,handleSubmit:l,formState:{errors:c}}=f({defaultValues:{documento:"",iPrId:d,archivo:t},mode:"onBlur"});return e("div",{children:r("form",{onSubmit:l(u=>{y.post(`${g}`,u).then(m=>{const o=m.data;o.success?(a.success("El archivo fue adjuntado correctamente"),s.handleClose(!1)):a.error(o.msg??"Error al adjuntar archivo")}).finally(()=>{})}),children:[r(x,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:[e("img",{src:t,alt:"Mensaje de imagen",style:{width:"40%"}}),e("div",{style:{flexBasis:"100%"},children:e(b,{control:i,name:"documento",required:!0,iField:n,type:"supercombobox"})})]}),e(j,{sx:{marginY:"10px"},fullWidth:!0,type:"submit",disabled:Object.keys(c).length>0,children:"Adjuntar"})]})})};export{A as default};
