import { useEffect } from "react"; import { Button } from "@/components/ui/button"; import { IpcClient } from "@/ipc/ipc_client"; import { toast } from "sonner"; import { useSettings } from "@/hooks/useSettings"; import { useDeepLink } from "@/contexts/DeepLinkContext"; import { ExternalLink } from "lucide-react"; import { useTheme } from "@/contexts/ThemeContext"; import { NeonDisconnectButton } from "@/components/NeonDisconnectButton"; export function NeonConnector() { const { settings, refreshSettings } = useSettings(); const { lastDeepLink, clearLastDeepLink } = useDeepLink(); const { isDarkMode } = useTheme(); useEffect(() => { const handleDeepLink = async () => { if (lastDeepLink?.type === "neon-oauth-return") { await refreshSettings(); toast.success("Successfully connected to Neon!"); clearLastDeepLink(); } }; handleDeepLink(); }, [lastDeepLink?.timestamp]); if (settings?.neon?.accessToken) { return (
You are connected to Neon Database
Neon Database has a good free tier with backups and up to 10 projects.