2
0

feat(bubbles): Add video bubble

This commit is contained in:
Baptiste Arnaud
2022-01-20 17:45:25 +01:00
parent 2d178978ef
commit df2474ef43
14 changed files with 432 additions and 40 deletions

View File

@ -4,17 +4,19 @@ import { SearchContextManager } from '@giphy/react-components'
import { UploadButton } from '../buttons/UploadButton'
import { GiphySearch } from './GiphySearch'
import { useTypebot } from 'contexts/TypebotContext'
import { ImageBubbleContent } from 'models'
type Props = {
url?: string
onSubmit: (url: string) => void
content?: ImageBubbleContent
onSubmit: (content: ImageBubbleContent) => void
}
export const ImageUploadContent = ({ url, onSubmit }: Props) => {
export const ImageUploadContent = ({ content, onSubmit }: Props) => {
const [currentTab, setCurrentTab] = useState<'link' | 'upload' | 'giphy'>(
'upload'
)
const handleSubmit = (url: string) => onSubmit({ url })
return (
<Stack>
<HStack>
@ -43,7 +45,11 @@ export const ImageUploadContent = ({ url, onSubmit }: Props) => {
)}
</HStack>
<BodyContent tab={currentTab} onSubmit={onSubmit} url={url} />
<BodyContent
tab={currentTab}
onSubmit={handleSubmit}
url={content?.url}
/>
</Stack>
)
}