import { FC, useRef, useEffect } from 'react' import Lottie, { LottieRefCurrentProps } from 'lottie-react' import download from '@/assets/Lottie/download.json' interface LoadingProps { play?: boolean // 是否播放 color?: string // 控制主色,比如 "#00BFFF" } const Downloading: FC = ({ play = true, color = '#00BFFF' }) => { const lottieRef = useRef(null) useEffect(() => { if (!lottieRef.current) return if (play) { lottieRef.current.play() } else { lottieRef.current.pause() } }, [play]) return (
) } export default Downloading