2
0

Add Bubble and Popup in embed lib v2

Closes #214
This commit is contained in:
Baptiste Arnaud
2023-01-09 14:51:36 +01:00
parent 4bf93b4872
commit 21f1c7a17e
38 changed files with 1586 additions and 96 deletions

View File

@ -0,0 +1,24 @@
import { useEffect } from 'react'
import type { BubbleProps } from '@typebot.io/js'
declare global {
namespace JSX {
interface IntrinsicElements {
'typebot-bubble': React.DetailedHTMLProps<
React.HTMLAttributes<HTMLElement>,
HTMLElement
>
}
}
}
export const Bubble = (props: BubbleProps) => {
useEffect(() => {
;(async () => {
const { registerBubbleComponent } = await import('@typebot.io/js')
registerBubbleComponent(props)
})()
}, [props])
return <typebot-bubble />
}