From 860c427f2873cbed50c271e1e191aeee30980391 Mon Sep 17 00:00:00 2001 From: Will Chen Date: Wed, 23 Apr 2025 11:35:04 -0700 Subject: [PATCH] show success UX for dyad add integration --- src/components/chat/DyadAddIntegration.tsx | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/components/chat/DyadAddIntegration.tsx b/src/components/chat/DyadAddIntegration.tsx index 4674828..2cc3dce 100644 --- a/src/components/chat/DyadAddIntegration.tsx +++ b/src/components/chat/DyadAddIntegration.tsx @@ -6,6 +6,7 @@ import { useAtomValue, atom, useAtom } from "jotai"; import { showError } from "@/lib/toast"; import { useStreamChat } from "@/hooks/useStreamChat"; import { selectedChatIdAtom } from "@/atoms/chatAtoms"; +import { useLoadApp } from "@/hooks/useLoadApp"; interface DyadAddIntegrationProps { node: { @@ -25,8 +26,10 @@ export const DyadAddIntegration: React.FC = ({ const { streamMessage } = useStreamChat(); const [isSetup, setIsSetup] = useAtom(isSetupAtom); const navigate = useNavigate(); + const { provider } = node.properties; const appId = useAtomValue(selectedAppIdAtom); + const { app } = useLoadApp(appId); const selectedChatId = useAtomValue(selectedChatIdAtom); const handleSetupClick = () => { @@ -38,6 +41,45 @@ export const DyadAddIntegration: React.FC = ({ setIsSetup(true); }; + if (app?.supabaseProjectName) { + return ( +
+
+ + + + + + Supabase integration complete + +
+
+ This app is connected to Supabase project:{" "} + + {app.supabaseProjectName} + +
+
+ ); + } + if (isSetup) { return (