import{j as e}from"./@radix-CFOkMR_E.js";import{B as u,E as l,c as f,S as h,$ as p,r as n,aA as j}from"./index-KsTz2dHG.js";import{S as g}from"./database-1xWSgZfO.js";import{c as o,L as c}from"./@react-router-CO-OsFwI.js";import"./@tanstack-k96lU_C-.js";import"./@reactflow-DIYUhKYX.js";function m({icon:t,estimatedTime:s,subtitle:a,title:r,comingSoon:i=!1,isRecommended:x=!1}){return e.jsxs(u,{className:`h-full w-full space-y-1 px-6 py-5 ${i&&"bg-neutral-50"}`,children:[t,e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:r}),x&&e.jsx(l,{className:"font-semibold",color:"green",size:"sm",children:"Recommended"}),i&&e.jsx(l,{className:"font-semibold",color:"purple",size:"sm",children:"Coming Soon"})]}),e.jsx("p",{className:"text-theme-text-secondary",children:a}),e.jsxs("p",{className:"text-text-xs text-theme-text-tertiary",children:["Estimated time: ",s," mins"]})]})}function y(){const{isError:t,isPending:s,data:a}=f();if(s)return e.jsx(h,{className:"h-[200px] w-full"});if(t)return e.jsx("div",{children:"Failed to load server info"});const r=p(a.deployment_type||"other");return e.jsxs("section",{className:"w-full space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-text-xl font-semibold",children:"Smart Stack Setup"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Use our smart tools to connect to your Cloud in a quick and simplified way."})]}),e.jsxs("div",{className:"grid w-full grid-cols-1 gap-6 md:grid-cols-2",children:[e.jsx(N,{isLocalDeployment:r}),e.jsx(v,{isLocalDeployment:r})]})]})}function N({isLocalDeployment:t}){const[s]=o(),a=n.stacks.create.newInfra+(s.size>=1?`?${s.toString()}`:"");return e.jsxs("div",{className:"relative",children:[t&&e.jsx(d,{}),e.jsx(c,{to:a,children:e.jsx(m,{title:"New Infrastructure",isRecommended:!0,subtitle:"Use a script to set a new cloud infrastructure from scratch",icon:e.jsx(g,{className:"h-6 w-6 fill-primary-400"}),estimatedTime:"3"})})]})}function v({isLocalDeployment:t}){const[s]=o(),a=n.stacks.create.existingInfra+(s.size>=1?`?${s.toString()}`:"");return e.jsxs("div",{className:"relative",children:[t&&e.jsx(d,{}),e.jsx(c,{to:a,children:e.jsx(m,{title:"Use existing Cloud",subtitle:"Connect to your existing Cloud and configure your components manually.",icon:e.jsx(j,{className:"h-6 w-6 fill-primary-400"}),estimatedTime:"15"})})]})}function d(){return e.jsx("div",{className:"group absolute flex h-full w-full items-center justify-center rounded-md border border-theme-border-moderate bg-white/70",children:e.jsx("div",{className:"hidden rounded-md bg-theme-text-primary px-3 py-2 text-text-xs text-theme-text-negative shadow-lg animate-in fade-in-0 fade-out-0 zoom-in-95 group-hover:block",children:"Smart Setup is not available for local deployments"})})}function I(){return e.jsx("section",{className:"layout-container flex gap-2 p-5",children:e.jsx(y,{})})}export{I as default};
