import React, { useEffect, useRef, useState } from 'react' import { EmbedBubbleStep } from 'models' import { TypingContent } from './TypingContent' type Props = { step: EmbedBubbleStep onTransitionEnd: () => void } export const showAnimationDuration = 400 export const EmbedBubble = ({ step, onTransitionEnd }: Props) => { const messageContainer = useRef(null) const [isTyping, setIsTyping] = useState(true) useEffect(() => { showContentAfterMediaLoad() // eslint-disable-next-line react-hooks/exhaustive-deps }, []) const showContentAfterMediaLoad = () => { setTimeout(() => { setIsTyping(false) onTypingEnd() }, 1000) } const onTypingEnd = () => { setIsTyping(false) setTimeout(() => { onTransitionEnd() }, showAnimationDuration) } return (
{isTyping ? : <>}