import{r as e,j as a}from"./main-pzSpmpV2.js";import{D as l}from"./layout-D23Ks5S8.js";import{C as h}from"./campaign-form-COpx8NjZ.js";import{S as g}from"./spinner-BwGdrg0I.js";import{F as f}from"./FetchWrapper-DtDh1OOQ.js";import"./dialog-CwPbkvSr.js";import"./form-BRsh_9c9.js";import"./label-DdsMBmyI.js";import"./index-C4bLmoCR.js";import"./input-6kwZWIt9.js";import"./textarea-CBfr8Pun.js";import"./loader-2-fAceJRLq.js";import"./index-BtdXaa8D.js";function T(){const[o,s]=e.useState(""),[n,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",s("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:n,type:o})})})})}export{T as default};
//# sourceMappingURL=index-BVLsAmk_.js.map
