import React from 'react';
import { Circle } from 'react-native-svg';
import { Animated } from 'react-native';
import useSpin from '../../hooks/useSpin';
const AnimatedElement = Animated.createAnimatedComponent(Circle);
const { PI } = Math;
const AnimatedCircle = ({ stroke }) => {
    const circumference = 20 * 2 * PI;
    const spin = useSpin();
    return (<AnimatedElement stroke={stroke} cx="25" cy="25" r="20" fill="none" strokeWidth="2" strokeDasharray={`${circumference} ${circumference}`} strokeDashoffset={spin}/>);
};
export default AnimatedCircle;
