feat(editor): ✨ Team workspaces
This commit is contained in:
@ -1,13 +1,16 @@
|
||||
import { useTypebot } from 'contexts/TypebotContext'
|
||||
import { useUser } from 'contexts/UserContext'
|
||||
import { useWorkspace } from 'contexts/WorkspaceContext'
|
||||
import { Plan } from 'db'
|
||||
import React, { useEffect, useState } from 'react'
|
||||
import { isCloudProdInstance } from 'services/utils'
|
||||
import { planToReadable } from 'services/workspace'
|
||||
import { initBubble } from 'typebot-js'
|
||||
|
||||
export const SupportBubble = () => {
|
||||
const { typebot } = useTypebot()
|
||||
const { user } = useUser()
|
||||
const { workspace } = useWorkspace()
|
||||
const [localTypebotId, setLocalTypebotId] = useState(typebot?.id)
|
||||
const [localUserId, setLocalUserId] = useState(user?.id)
|
||||
|
||||
@ -33,7 +36,7 @@ export const SupportBubble = () => {
|
||||
Email: user?.email ?? undefined,
|
||||
'Typebot ID': typebot?.id,
|
||||
'Avatar URL': user?.image ?? undefined,
|
||||
Plan: planToReadable(user?.plan),
|
||||
Plan: planToReadable(workspace?.plan),
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -42,17 +45,3 @@ export const SupportBubble = () => {
|
||||
|
||||
return <></>
|
||||
}
|
||||
|
||||
const planToReadable = (plan?: Plan) => {
|
||||
if (!plan) return
|
||||
switch (plan) {
|
||||
case 'FREE':
|
||||
return 'Free'
|
||||
case 'LIFETIME':
|
||||
return 'Lifetime'
|
||||
case 'OFFERED':
|
||||
return 'Offered'
|
||||
case 'PRO':
|
||||
return 'Pro'
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user