import { useTypebot } from '@/features/editor/providers/TypebotProvider' import { useUser } from '@/features/account/hooks/useUser' import { useWorkspace } from '@/features/workspace/WorkspaceProvider' import React, { useEffect, useState } from 'react' import { Bubble, BubbleProps } from '@typebot.io/nextjs' import { planToReadable } from '@/features/billing/helpers/planToReadable' import { Plan } from '@typebot.io/prisma' export const SupportBubble = (props: Omit) => { const { typebot } = useTypebot() const { user } = useUser() const { workspace } = useWorkspace() const [lastViewedTypebotId, setLastViewedTypebotId] = useState(typebot?.id) useEffect(() => { if (!typebot?.id) return if (lastViewedTypebotId === typebot?.id) return setLastViewedTypebotId(typebot?.id) }, [lastViewedTypebotId, typebot?.id]) if (!workspace?.plan || workspace.plan === Plan.FREE) return null return ( ) }