import{r as e,j as a}from"./main-C5rJoLCl.js";import{D as l}from"./layout-2E7L6V5j.js";import{C as h}from"./campaign-form-B-szhSuX.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"./textarea-DrZBTCi5.js";function N(){const[s,n]=e.useState(""),[o,c]=e.useState(null),[m,r]=e.useState(!0),p=new f(linkfiliate==null?void 0:linkfiliate.pluginApiUrl,linkfiliate==null?void 0:linkfiliate.nonce),t=window.location.hash.split("/").pop();e.useEffect(()=>{document.title="Edit Category",n("edit"),t&&(async()=>{try{r(!0);const i=await p.get(`/category/get/${t}`);c(i.data)}catch(i){console.error("Error fetching campaign:",i)}finally{r(!1)}})()},[t]);const d=[{name:"Dashboard",href:"#/dashboard"},{name:"Categories",href:"#/category"},{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:m?a.jsx("div",{className:"min-h-screen items-center",children:a.jsx(g,{children:"Loading..."})}):a.jsx(h,{initialData:o,type:s})})})})}export{N as default};
//# sourceMappingURL=index-DHawqjFy.js.map
