import { useStore } from '@nanostores/react'; import { netlifyConnection, fetchNetlifyStats } from '~/lib/stores/netlify'; import { chatId } from '~/lib/persistence/useChatHistory'; import * as Tooltip from '@radix-ui/react-tooltip'; import { useEffect } from 'react'; export function NetlifyDeploymentLink() { const connection = useStore(netlifyConnection); const currentChatId = useStore(chatId); useEffect(() => { if (connection.token && currentChatId) { fetchNetlifyStats(connection.token); } }, [connection.token, currentChatId]); const deployedSite = connection.stats?.sites?.find((site) => site.name.includes(`bolt-diy-${currentChatId}`)); if (!deployedSite) { return null; } return ( { e.stopPropagation(); // Add this to prevent click from bubbling up }} >
{deployedSite.url} ); }