2022-12-22 17:02:34 +01:00
|
|
|
import { useEffect } from 'react'
|
|
|
|
|
import type { BotProps } from '@typebot.io/js'
|
|
|
|
|
|
|
|
|
|
type Props = BotProps
|
|
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
|
namespace JSX {
|
|
|
|
|
interface IntrinsicElements {
|
|
|
|
|
'typebot-standard': React.DetailedHTMLProps<
|
|
|
|
|
React.HTMLAttributes<HTMLElement>,
|
|
|
|
|
HTMLElement
|
|
|
|
|
>
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const Standard = (props: Props) => {
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
;(async () => {
|
2023-01-09 14:51:36 +01:00
|
|
|
const { registerStandardComponent } = await import('@typebot.io/js')
|
|
|
|
|
registerStandardComponent(props)
|
2022-12-22 17:02:34 +01:00
|
|
|
})()
|
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
}, [])
|
|
|
|
|
|
|
|
|
|
return <typebot-standard />
|
|
|
|
|
}
|