import{r as a,j as e,a as g,S as d,B as C,G as f}from"./Base-rYbAJ89M.js";import{R as u,a as j,A as b,b as z}from"./Add-b3mR2GNL.js";import{r as O}from"./render-hCAsEABD.js";function S({successCallback:i,failureCallback:t,cancelCallback:o,createMode:s}){const[l,c]=a.useState(""),[r,p]=a.useState(""),[m,k]=a.useState(""),[x,T]=a.useState("");localStorage.getItem("apiBaseUrl");const h=()=>n=>{n.preventDefault(),i({id:1,name:"New Organization"})};return e.jsxs(g,{p:2,children:[e.jsx(u,{label:"Name",helperText:m,fullWidth:!0,margin:"normal",value:l,onChange:n=>c(n.target.value)}),e.jsx(u,{label:"Description",helperText:x,fullWidth:!0,margin:"normal",multiline:!0,rows:4,value:r,onChange:n=>p(n.target.value)}),"Logo: File upload component",e.jsxs(j,{children:[e.jsx(d,{onClick:o,children:"Cancel"}),e.jsxs(d,{type:"submit",color:"primary",onClick:h(),children:[s?"Create":"Update"," Organization"]})]})]})}function D(){const[i,t]=a.useState(!1),[o,s]=a.useState(null),l=r=>{console.log("Organization created successfully:",r),t(!1)},c=r=>{console.error("Error creating organization:",r)};return e.jsxs(C,{breadCrumbList:[{label:"Organizations",href:"#"}],showOrganizationSwitcher:!1,children:[e.jsx(f,{size:12,py:2,pl:2,children:e.jsx(g,{p:2,sx:{border:"1px solid",borderColor:"grey.300",borderRadius:1,minHeight:300},children:e.jsx(d,{variant:"outlined",startIcon:e.jsx(b,{}),sx:{marginBottom:2},onClick:()=>{s(e.jsx(S,{successCallback:l,failureCallback:c,cancelCallback:()=>t(!1),createMode:!0})),t(!0)},children:"Add an Organization"})})}),e.jsx(z,{open:i,onClose:()=>t(!1),fullWidth:!0,maxWidth:"sm",children:o})]})}O({children:e.jsx(D,{})});
//# sourceMappingURL=organizations-5mGu7xmA.js.map
