import{Z as u,r as i,t as o,j as e,N as m}from"./index-B-YXshIJ.js";import{C as g}from"./check-DaW7r622.js";const b=()=>{const l=u("first-org"),[t,d]=i.useState(""),a=o.auth.verifySession.useQuery().data,s=o.organization.createOrganization.useMutation(),c=i.useCallback(async r=>{if(r.preventDefault(),!a)return;const n=await s.mutateAsync({name:t,userEmail:a.email});n&&(localStorage.setItem("currentOrganization",JSON.stringify({value:n._id.toString(),label:n.name})),window.location.href="/demo?auth=true")},[s,a,t]);return e.jsx("div",{className:"flex items-center justify-center pt-20",children:e.jsxs("div",{className:"bg-white rounded-xl shadow border border-gray-200 p-10",children:[l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-4 flex items-center justify-center",children:e.jsx("div",{className:"border-4 rounded-full border-purple-900 p-1",children:e.jsx(g,{className:"h-12 w-12 text-purple-900 "})})}),e.jsx("h3",{className:"text-center text-gray-900 text-2xl font-semibold leading-9 pb-3",children:"Account Created!"}),e.jsxs("p",{className:"text-center text-gray-600 text-base font-normal leading-tight",children:["Your account has been successfully created. ",e.jsx("br",{}),"Let’s begin by creating your organization."]})]}):e.jsx("h3",{className:"text-center text-gray-900 text-2xl font-semibold leading-9 pb-3",children:"Add Your Organization"}),e.jsx("form",{className:"mt-6",onSubmit:c,children:e.jsxs("div",{children:[e.jsx("label",{htmlFor:"organization",className:"pr-2 pb-2 text-gray-900 text-base font-semibold",children:"Organization Name"}),e.jsx("div",{className:"mt-1 mb-3 rounded-md shadow-sm",children:e.jsx("input",{id:"organization",onChange:r=>d(r.target.value),className:"border border-gray-300 rounded-md px-3 py-3 placeholder-gray-400 w-full",placeholder:"My Organization Inc."})}),e.jsx("button",{type:"submit",className:m(t===""?"bg-slate-300 px-5 py-3 text-stone-700 cursor-not-allowed":"bg-gradient-to-r from-purple-950 to-purple-800 text-white cursor-pointer","px-5 py-3 rounded-md w-full text-base font-semibold"),disabled:t==="",children:"Create Organization"})]})})]})})};export{b as default};
