1import{a6 as d,h as p,a5 as x,j as e,aa as j}from"./index-C3hYg7Vm.js";import{d as h,e as f,r as s,L as v}from"./react-DaZfdddc.js";import{C as g,A as N,B as y}from"./ui-Bc_efa8_.js";function k(){const n=h().token??"",r=f(),{user:i,initializing:o}=d(),[c,m]=s.useState(null),[a,u]=s.useState(null),l=s.useRef(!1);return s.useEffect(()=>{if(!(o||l.current)){if(!i){r(`/login?next=${encodeURIComponent(`/invite/${n}`)}`,{replace:!0});return}l.current=!0,p.acceptInvite(n).then(t=>u(t)).catch(t=>m(t instanceof x?t.message:"This invitation is no longer valid."))}},[o,i,n,r]),e.jsx("div",{className:"app-shell flex min-h-screen items-center justify-center p-6",children:e.jsx(g,{className:"w-full max-w-md space-y-4 p-6 text-center",children:c?e.jsxs(e.Fragment,{children:[e.jsx(N,{tone:"error",children:c}),e.jsx(v,{to:"/projects",className:"text-sm font-medium text-brand-700 hover:underline",children:"Go to your projects"})]}):a?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"font-display text-xl font-bold text-slate-900",children:"You're in!"}),e.jsxs("p",{className:"text-sm text-slate-500",children:["You joined as ",e.jsx("span",{className:"font-medium",children:a.role}),"."]}),e.jsx(y,{onClick:()=>r(`/projects/${a.project_id}`),children:"Open project"})]}):e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(j,{label:"Accepting invitationâ¦"})})})})}export{k as InvitePage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.