@@ -6,23 +6,17 @@ import {
66 ArrowRightIcon ,
77 CheckIcon ,
88 CircleAlertIcon ,
9- DatabaseIcon ,
10- InfinityIcon ,
119 InfoIcon ,
1210 MoreHorizontalIcon ,
1311 PencilIcon ,
14- PlusIcon ,
15- ShieldCheckIcon ,
1612 Trash2Icon ,
17- WalletIcon ,
1813} from "lucide-react" ;
1914import Link from "next/link" ;
2015import { useState } from "react" ;
2116import { useForm } from "react-hook-form" ;
2217import { toast } from "sonner" ;
2318import { z } from "zod" ;
2419import type { Team } from "@/api/team/get-team" ;
25- import { CheckoutButton } from "@/components/billing/billing" ;
2620import { Alert , AlertDescription , AlertTitle } from "@/components/ui/alert" ;
2721import { Badge , type BadgeProps } from "@/components/ui/badge" ;
2822import { Button } from "@/components/ui/button" ;
@@ -31,20 +25,10 @@ import {
3125 Dialog ,
3226 DialogContent ,
3327 DialogDescription ,
34- DialogFooter ,
3528 DialogHeader ,
3629 DialogTitle ,
37- DialogTrigger ,
3830} from "@/components/ui/dialog" ;
39- import {
40- Drawer ,
41- DrawerContent ,
42- DrawerDescription ,
43- DrawerFooter ,
44- DrawerHeader ,
45- DrawerTitle ,
46- DrawerTrigger ,
47- } from "@/components/ui/drawer" ;
31+
4832import {
4933 DropdownMenu ,
5034 DropdownMenuContent ,
@@ -72,7 +56,6 @@ import {
7256 TableRow ,
7357} from "@/components/ui/table" ;
7458import { Textarea } from "@/components/ui/textarea" ;
75- import { useIsMobile } from "@/hooks/use-mobile" ;
7659import {
7760 type DeleteCloudHostedEngineParams ,
7861 deleteCloudHostedEngine ,
@@ -84,7 +67,6 @@ import {
8467} from "@/hooks/useEngine" ;
8568import { EngineIcon } from "@/icons/EngineIcon" ;
8669import { useDashboardRouter } from "@/lib/DashboardRouter" ;
87- import { cn } from "@/lib/utils" ;
8870
8971type DeletedCloudHostedEngine = (
9072 params : DeleteCloudHostedEngineParams ,
@@ -126,96 +108,6 @@ export function EngineInstancesTable(props: {
126108 ) ;
127109}
128110
129- export function DedicatedEngineSubscriptionButton ( props : { team : Team } ) {
130- const [ open , setOpen ] = useState ( false ) ;
131- const isMobile = useIsMobile ( ) ;
132-
133- const trigger = (
134- < Button className = "gap-2 rounded-full" size = "sm" >
135- < PlusIcon className = "size-3.5" />
136- Deploy Dedicated Engine
137- </ Button >
138- ) ;
139-
140- const title = (
141- < div className = "flex flex-row items-center gap-2" >
142- < div className = "grid size-8 place-items-center rounded-full bg-warning-text" >
143- < DatabaseIcon className = "size-4 text-white" />
144- </ div >
145- < span className = "font-semibold text-lg" > Dedicated Engine</ span >
146- </ div >
147- ) ;
148-
149- const content = (
150- < div className = "flex flex-col items-start justify-center gap-4 px-4 md:px-0" >
151- < ul className = "flex flex-col gap-1 self-start text-muted-foreground text-sm" >
152- < li className = "flex items-center gap-2" >
153- < ShieldCheckIcon className = "size-4 text-foreground" />
154- Isolated environment
155- </ li >
156- < li className = "flex items-center gap-2" >
157- < WalletIcon className = "size-4 text-foreground" />
158- EOA or Smart Wallets
159- </ li >
160- < li className = "flex items-center gap-2" >
161- < InfinityIcon className = "size-4 text-foreground" />
162- No transaction usage limits or charges
163- </ li >
164- </ ul >
165- </ div >
166- ) ;
167-
168- if ( isMobile ) {
169- return (
170- < Drawer onOpenChange = { setOpen } open = { open } >
171- < DrawerTrigger asChild > { trigger } </ DrawerTrigger >
172- < DrawerContent className = "max-h-[90vh]" >
173- < DrawerHeader >
174- < DrawerTitle > { title } </ DrawerTitle >
175- < DrawerDescription >
176- Instantly deploy a dedicated engine instance for your team.
177- </ DrawerDescription >
178- </ DrawerHeader >
179- { content }
180- < DrawerFooter >
181- < CheckoutButton
182- billingStatus = { props . team . billingStatus }
183- sku = "product:engine_standard"
184- teamSlug = { props . team . slug }
185- >
186- Deploy Now · $299 / month
187- </ CheckoutButton >
188- </ DrawerFooter >
189- </ DrawerContent >
190- </ Drawer >
191- ) ;
192- }
193-
194- return (
195- < Dialog onOpenChange = { setOpen } open = { open } >
196- < DialogTrigger asChild > { trigger } </ DialogTrigger >
197- < DialogContent >
198- < DialogHeader >
199- < DialogTitle > { title } </ DialogTitle >
200- < DialogDescription >
201- Instantly deploy a dedicated engine instance for your team.
202- </ DialogDescription >
203- </ DialogHeader >
204- { content }
205- < DialogFooter >
206- < CheckoutButton
207- billingStatus = { props . team . billingStatus }
208- sku = "product:engine_standard"
209- teamSlug = { props . team . slug }
210- >
211- Deploy Now · $299 / month
212- </ CheckoutButton >
213- </ DialogFooter >
214- </ DialogContent >
215- </ Dialog >
216- ) ;
217- }
218-
219111export function EngineInstancesTableUI ( props : {
220112 instances : EngineInstance [ ] ;
221113 engineLinkPrefix : string ;
@@ -896,10 +788,6 @@ function DeleteEngineSubscriptionModalContent(props: {
896788}
897789
898790function EmptyEngineState ( props : { team : Team ; projectSlug : string } ) {
899- const [ selectedTab , setSelectedTab ] = useState <
900- "self-hosted" | "cloud-hosted"
901- > ( "cloud-hosted" ) ;
902-
903791 return (
904792 < div className = "flex flex-col items-center justify-center rounded-lg border bg-card px-4 py-12 lg:px-6" >
905793 < div className = "mb-4 rounded-full border bg-card p-2" >
@@ -908,75 +796,34 @@ function EmptyEngineState(props: { team: Team; projectSlug: string }) {
908796
909797 < h2 className = "mb-1 font-semibold text-xl" > No Engine instances found</ h2 >
910798 < p className = "mb-6 max-w-lg text-center text-muted-foreground text-sm" >
911- Get started with one of the options below to add your first engine
912- instance.
799+ Import an Engine instance running on your own infrastructure.
913800 </ p >
914801
915802 < div className = "w-full max-w-md" >
916- < div className = "mx-auto max-w-sm" >
917- < div className = "grid grid-cols-2 gap-1 rounded-lg border p-1" >
918- < Button
919- className = { cn ( selectedTab === "cloud-hosted" && "bg-accent" ) }
920- onClick = { ( ) => setSelectedTab ( "cloud-hosted" ) }
921- size = "sm"
922- variant = "ghost"
923- >
924- Managed
925- </ Button >
803+ < div className = "h-5" />
926804
805+ < div className = "flex flex-col text-center" >
806+ < h3 className = "mb-0.5 font-semibold text-base" > Self-Hosted Engine</ h3 >
807+ < p className = "text-muted-foreground text-sm" >
808+ Add engine instance running on your own infrastructure.
809+ </ p >
810+ < div className = "h-4" />
811+ < div className = "mt-auto" >
927812 < Button
928- className = { cn ( selectedTab === "self-hosted" && "bg-accent" ) }
929- onClick = { ( ) => setSelectedTab ( "self-hosted" ) }
813+ asChild
814+ className = "w-full gap-2"
930815 size = "sm"
931- variant = "ghost "
816+ variant = "default "
932817 >
933- Self-hosted
818+ < Link
819+ href = { `/team/${ props . team . slug } /${ props . projectSlug } /engine` }
820+ >
821+ Import self-hosted Engine
822+ < ArrowRightIcon size = { 16 } />
823+ </ Link >
934824 </ Button >
935825 </ div >
936826 </ div >
937-
938- < div className = "h-5" />
939-
940- { selectedTab === "self-hosted" && (
941- < div className = "flex flex-col text-center" >
942- < h3 className = "mb-0.5 font-semibold text-base" >
943- Self-Hosted Engine
944- </ h3 >
945- < p className = "text-muted-foreground text-sm" >
946- Add engine instance running on your own infrastructure.
947- </ p >
948- < div className = "h-4" />
949- < div className = "mt-auto" >
950- < Button
951- asChild
952- className = "w-full gap-2"
953- size = "sm"
954- variant = "default"
955- >
956- < Link
957- href = { `/team/${ props . team . slug } /${ props . projectSlug } /engine` }
958- >
959- Import self-hosted Engine
960- < ArrowRightIcon size = { 16 } />
961- </ Link >
962- </ Button >
963- </ div >
964- </ div >
965- ) }
966-
967- { selectedTab === "cloud-hosted" && (
968- < div className = "flex flex-col text-center" >
969- < h3 className = "mb-0.5 font-semibold text-base" > Managed Engine</ h3 >
970- < p className = "text-muted-foreground text-sm" >
971- Deploy a managed engine instance to your team. < br /> We recommend
972- using Engine Cloud in most cases.
973- </ p >
974- < div className = "h-4" />
975- < div className = "mt-auto" >
976- < DedicatedEngineSubscriptionButton team = { props . team } />
977- </ div >
978- </ div >
979- ) }
980827 </ div >
981828
982829 < div className = "mt-4 text-center text-muted-foreground text-sm" >
0 commit comments