From e896438f46e86670230f0e60298b50e3c20fb4a5 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 30 Sep 2025 08:32:17 +0000 Subject: [PATCH] Add connection state and helpers cgen-f722e28e219742c8b445108a4e02400d --- client/pages/Dashboard.tsx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/client/pages/Dashboard.tsx b/client/pages/Dashboard.tsx index dea1c7b1..8c810935 100644 --- a/client/pages/Dashboard.tsx +++ b/client/pages/Dashboard.tsx @@ -83,6 +83,43 @@ export default function Dashboard() { }); const [userPosts, setUserPosts] = useState([]); const [applications, setApplications] = useState([]); + const [connectionAction, setConnectionAction] = useState(null); + + type ProviderKey = "google" | "github"; + + const linkedProviderSet = useMemo( + () => new Set(linkedProviders.map((item) => item.provider)), + [linkedProviders], + ); + + const linkedProviderMap = useMemo(() => { + const map: Record = {}; + linkedProviders.forEach((lp) => { + map[lp.provider] = lp; + }); + return map; + }, [linkedProviders]); + + const oauthConnections = useMemo( + () => + [ + { + provider: "google" as ProviderKey, + name: "Google", + description: "Link your Google account for one-click access.", + Icon: Globe, + gradient: "from-red-500 to-yellow-500", + }, + { + provider: "github" as ProviderKey, + name: "GitHub", + description: "Connect your GitHub account to sync contributions.", + Icon: Github, + gradient: "from-gray-600 to-gray-900", + }, + ] as const, + [], + ); useEffect(() => { console.log("Dashboard useEffect:", {