2
0

feat(editor): Team workspaces

This commit is contained in:
Baptiste Arnaud
2022-05-13 15:22:44 -07:00
parent 6c2986590b
commit f0fdf08b00
132 changed files with 3354 additions and 1228 deletions

View File

@ -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'
}
}