import{r as i,j as a}from"./main-C5rJoLCl.js";import{D as l}from"./layout-2E7L6V5j.js";import{C as h}from"./campaign-form-B7v8vM06.js";import{S as g}from"./spinner-zDOxBldC.js";import{F as f}from"./FetchWrapper-DZ79aYT8.js";import"./dialog-DoT6WXg8.js";import"./form-TtPPMvDl.js";import"./index-C4bLmoCR.js";import"./checkbox-1SV0mGsA.js";import"./textarea-DrZBTCi5.js";import"./command-dpeRkPW7.js";import"./popover-Bp_kD6bA.js";import"./separator-CJhMgss0.js";import"./chevrons-up-down-DCCBwKIg.js";function $(){const[r,s]=i.useState(""),[o,m]=i.useState(null),[p,n]=i.useState(!0),c=new f(linkfiliate==null?void 0:linkfiliate.pluginApiUrl,linkfiliate==null?void 0:linkfiliate.nonce),t=window.location.hash.split("/").pop();i.useEffect(()=>{document.title="Edit Campaigns",s("edit"),t&&(async()=>{try{n(!0);const e=await c.get(`/campaign/get/${t}`);m(e.data)}catch(e){console.error("Error fetching campaign:",e)}finally{n(!1)}})()},[t]);const d=[{name:"Dashboard",href:"#/dashboard"},{name:"Campaigns",href:"#/campaign"},{name:`New ${t}`}];return a.jsx(l,{breadcrumb:d,children:a.jsx("div",{className:"space-y-6",children:a.jsx("div",{className:"p-4 shadow rounded-sm",children:p?a.jsx("div",{className:"min-h-screen items-center",children:a.jsx(g,{children:"Loading..."})}):a.jsx(h,{initialData:o,type:r})})})})}export{$ as default};
//# sourceMappingURL=index-C4CEl789.js.map
