import { View, Text, Image, Pressable } from "react-native"; import React, { useEffect, useState } from "react"; import { ai, icons } from "../../assets"; import { BlurView } from "expo-blur"; import Style, { size } from "../../styles/Style"; import { Palette } from "../../styles"; import { FONT_FAMILY } from "../../styles/Fonts"; import ProgressBar from "../../components/ProgressBar"; import { goBack, navigate } from "../../navigation/NavigationService"; import { Routes } from "../../navigation"; import GradientButton from "../../components/GradientButton"; const CreatingSong = ({ active }) => { const [progress, setProgress] = useState(0); useEffect(() => { if (active) { const interval = setInterval(() => { setProgress((prevProgress) => { if (prevProgress >= 100) { clearInterval(interval); return 100; } return prevProgress + 1; }); }, 100); return () => clearInterval(interval); } }, [active]); return ( Ton texte est{"\n"}en cours de création {progress}% navigate(Routes.SongReady)} /> ); }; export default CreatingSong;