2
0

⚗️ Implement bot v2 MVP (#194)

Closes #190
This commit is contained in:
Baptiste Arnaud
2022-12-22 17:02:34 +01:00
committed by GitHub
parent e55823e011
commit 1a3869ae6d
202 changed files with 8060 additions and 1152 deletions

View File

@ -0,0 +1,27 @@
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 () => {
const { registerWebComponents } = await import('@typebot.io/js')
registerWebComponents(props)
})()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
return <typebot-standard />
}

View File

@ -0,0 +1,6 @@
/* eslint-disable import/no-anonymous-default-export */
import { Standard } from './Standard'
export { Standard }
export default { Standard }