import{b as d,$ as j,h as b,k as _,i as w,j as e,_ as n,q as C}from"./main.2.8.1.js";import{u as I,h as v,d as o}from"./react-router-dom.9mCuUg3q.js";import{S as y}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as F,I as D,s as N}from"./Integrations.D2bgBas2.js";import{h as k,c as m}from"./SuiteDashCommonFunc.DN27WAyh.js";import{S as R}from"./SuiteDashIntegLayout.BVmyAy0O.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function J({allIntegURL:l}){const c=I(),{id:E}=v(),[a,L]=d(j),[t,i]=d(b),[f,p]=o.useState(!1),[g,u]=o.useState({}),[h,s]=o.useState({show:!1}),r=_(w),x=()=>{if(!m(t)){s({show:!0,msg:n("Please map mandatory fields","bit-integrations")});return}if(!t.selectedRole){C.error("Please select a Role");return}N({flow:a,allIntegURL:l,conf:t,navigate:c,edit:1,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(y,{snack:h,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:n("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:S=>k(S,t,i),name:"name",value:t.name,type:"text",placeholder:n("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(F,{entity:a.triggered_entity,setSnackbar:s}),e.jsx(R,{formID:a.triggered_entity_id,formFields:r,suiteDashConf:t,setSuiteDashConf:i,loading:g,setLoading:u,setIsLoading:p,setSnackbar:s}),e.jsx(D,{edit:!0,saveConfig:x,disabled:!m(t),isLoading:f,dataConf:t,setDataConf:i,formFields:r}),e.jsx("br",{})]})}export{J as default};
