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-dNe6i2rS.js";import{u as j}from"./useLastProject-Du1ajmeV.js";import{C as s}from"./project-eQY1xQe-.js";import{C as x}from"./card-BeQtvmcJ.js";import{A as g}from"./animated-progress-DY4TkPAt.js";import{A as e}from"./constants-CHYRqupQ.js";import{u as N}from"./usePollProjectStatus-uiAwfdyN.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-DPrT0V3d.js";import"./index-DURBtSjL.js";import"./apply-CIuXDHQi.js";import"./concat-CTXo1gGM.js";import"./sortBy-COer1Ia5.js";import"./juxt-B5kKHsyp.js";import"./converge-D7u3m7i4.js";import"./includes-ucXR_9jq.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};
