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