import { useAnimation } from "framer-motion"; import React, { useEffect } from "react"; import { Flex } from "rebass"; import { AnimatedBox } from "../animated"; function ProgressBar(props) { const { width, progress, duration = 1, onLoadingEnd, sx } = props; const animation = useAnimation(); useEffect(() => { animation.start({ width: `${progress}%`, transition: { duration } }); }, [animation, progress, duration]); return ( ); } export default ProgressBar;