import React from 'react'; import { StyleProp, View, ViewStyle } from 'react-native'; import { LoadingDot } from './LoadingDot'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; type Props = { diameter?: number; duration?: number; numberOfDots?: number; spacing?: number; style?: StyleProp; }; export const LoadingDots: React.FC = (props) => { const { diameter = 4, duration = 1500, numberOfDots = 3, spacing: spacingProp, style } = props; const { theme: { loadingDots: { container, spacing }, }, } = useTheme(); const halfSpacing = spacingProp ? spacingProp / 2 : spacing / 2; const offsetLength = duration / numberOfDots; return ( {Array.from(Array(numberOfDots)).map((_item, index) => ( ))} ); };