diff --git a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/import/import-engine-dialog.tsx b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/import/import-engine-dialog.tsx index 04ff3953eec..1ff478e9e67 100644 --- a/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/import/import-engine-dialog.tsx +++ b/apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/engine/(general)/import/import-engine-dialog.tsx @@ -8,6 +8,7 @@ import { ExternalLinkIcon, } from "lucide-react"; import Link from "next/link"; +import { useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; @@ -17,7 +18,6 @@ import { Dialog, DialogContent, DialogDescription, - DialogFooter, DialogHeader, DialogTitle, DialogTrigger, @@ -70,6 +70,7 @@ export function ImportEngineButton(props: { teamSlug: string; projectSlug: string; }) { + const [isOpen, setIsOpen] = useState(false); const router = useDashboardRouter(); const form = useForm({ resolver: zodResolver(formSchema), @@ -82,7 +83,7 @@ export function ImportEngineButton(props: { const importMutation = useMutation({ mutationFn: async (importParams: ImportEngineParams) => { await importEngine({ ...importParams, teamIdOrSlug: props.teamSlug }); - router.push(`/team/${props.teamSlug}/${props.projectSlug}/engine`); + router.refresh(); }, }); @@ -90,6 +91,7 @@ export function ImportEngineButton(props: { try { await importMutation.mutateAsync(data); toast.success("Engine imported successfully"); + setIsOpen(false); } catch (e) { const message = e instanceof Error ? e.message : undefined; toast.error( @@ -102,42 +104,40 @@ export function ImportEngineButton(props: { }; return ( -
- - - - - + + + + - - + + + + Import Engine Instance Import an Engine instance hosted on your infrastructure. -
-
- - Get help setting up Engine for free - - -
+
+ + Get help setting up Engine for free + + -
+
Name URL
- - - - -
- - + + + + +
); }