import React from 'react'; import { Animated, Easing, StyleSheet, View } from 'react-native'; const Dot = ({ delay, color }: { delay: number; color: string }): React.JSX.Element => { const v = React.useRef(new Animated.Value(0)).current; React.useEffect(() => { const loop = Animated.loop( Animated.sequence([ Animated.delay(delay), Animated.timing(v, { toValue: 1, duration: 350, easing: Easing.inOut(Easing.ease), useNativeDriver: true }), Animated.timing(v, { toValue: 0, duration: 350, easing: Easing.inOut(Easing.ease), useNativeDriver: true }), ]), ); loop.start(); return () => loop.stop(); }, [delay, v]); return ( ); }; export const TypingBubble = ({ color }: { color: string }): React.JSX.Element => ( ); const styles = StyleSheet.create({ wrap: { flexDirection: 'row', backgroundColor: '#fff', borderRadius: 18, paddingHorizontal: 12, paddingVertical: 10 }, dot: { width: 8, height: 8, borderRadius: 4, marginHorizontal: 3 }, });