import * as React from 'react'; import {View} from 'react-native'; import {Style} from 'twrnc/dist/esm/types'; import Image from '../Image'; import {TailwindFn} from 'twrnc'; type Props = { tw: TailwindFn; steps: number; current: number; style?: Style; }; const Info = ({tw, steps, current, style}: Props): JSX.Element => { const defaultStyles = tw`h-1`; const [svg, setSvg] = React.useState(` `); const [imageWidth, setImageWidth] = React.useState(0); React.useEffect(() => { let x = 0.29895; const space = 3; const width = 17; const diameter = 4; const imageWidth_ = (steps - 1) * diameter + width + (space * steps - 1); let str = ``; for (let i = 0; i < steps; i += 1) { if (i === current) { str += ``; x += space + width; } else { str += ``; x += space + diameter; } } str += ''; setSvg(str); setImageWidth(imageWidth_); }, [steps, current]); return ( ); }; export default Info;