import{r as u,j as i}from"./vendor-react-wBh_31cN.js";import{g as n,r as o,R as l,G as d,aq as f}from"./index-BKr2rJhV.js";import{u as j}from"./useLastProject-CDGr1y3w.js";import{C as s}from"./project-eQY1xQe-.js";import{C as x}from"./card-DISTA6Ay.js";import{A as g}from"./animated-progress-BdqEbBYd.js";import{A as e}from"./constants-CHYRqupQ.js";import{u as N}from"./usePollProjectStatus-WhRoB9Sc.js";import{u as v,N as m}from"./vendor-router-D1GqFWiT.js";import"./vendor-redux-CJZrIb6x.js";import"./vendor-utils-OeoE2qq_.js";import"./vendor-icons-BUUmD6ht.js";import"./vendor-radix-BRyWS4bQ.js";import"./vendor-grid-CeFlDWv4.js";import"./useSortedProjects-B0vFqd_s.js";import"./index-BeaoFlb1.js";import"./apply-BmJxqxKH.js";import"./concat-AxOj0lUI.js";import"./sortBy-DS9fyPwj.js";import"./juxt-BvCFisbd.js";import"./converge-BDz-h6lA.js";import"./includes-D04d5Ytc.js";const E=({projectId:r})=>{const a=v(),{project:t,isLoading:c}=N({projectId:r,interval:3e3}),p=c||(t==null?void 0:t.creationStatus)===s.ONGOING;return u.useEffect(()=>{(t==null?void 0:t.creationStatus)===s.DONE&&setTimeout(()=>{a(n(o.project.prj.view,o.project.value,{id:r}))},1e3)},[a,t==null?void 0:t.creationStatus,r]),i.jsx(x,{className:"mt-[100px]",children:i.jsxs("div",{className:"flex w-full flex-col items-center p-5",children:[i.jsx(l,{bold:!0,className:"mb-5 mt-2.5 text-lg text-quartz-gray",children:"Building your project"}),i.jsx(g,{minimum:.7,isAnimating:p,animationDuration:e/100,incrementDuration:e/25}),i.jsx(d,{variant:"secondary",className:"mt-5",onClick:()=>{window.location.href=`/${o.project.list}`},children:"Back to project list"})]})})},J=()=>{const{data:r,isLoading:a,isSuccess:t}=j();return r&&r.creationStatus===s.ONGOING?i.jsx(E,{projectId:r.projectId}):r?i.jsx(m,{to:n(o.project.prj.view,o.project.value,{id:r.projectId})}):!a&&t?i.jsx(m,{to:o.project.list}):i.jsx(f,{})};export{J as default};
