import React, { useEffect, useState } from 'react'; import { BrowserRouter as Router, Route, Link, Routes } from 'react-router-dom'; import axios from 'axios'; import './App.css'; import Influencers from './Influencers'; function App() { const [downloadedFiles, setDownloadedFiles] = useState([]); const [isAuthenticated, setIsAuthenticated] = useState(false); const [adminPassword, setAdminPassword] = useState(''); useEffect(() => { fetchDownloadedFiles(); const interval = setInterval(() => { fetchDownloadedFiles(); }, 60000); // Fetch new content every minute return () => clearInterval(interval); }, []); const fetchDownloadedFiles = async () => { try { const response = await axios.get('http://localhost:5001/downloads'); setDownloadedFiles(response.data); } catch (error) { console.error('Error fetching downloaded files:', error); } }; const handleLogin = (password) => { setAdminPassword(password); setIsAuthenticated(true); }; return (

Insta Local

{downloadedFiles.length === 0 ? (

No content available

) : ( downloadedFiles.map((file, index) => { const fileUrl = `http://localhost:5001/static/${file}`; return (
{file.endsWith('.mp4') ? ( ) : ( {file} )}
); }) )}
} /> ) : ( ) } />
); } const Login = ({ onLogin }) => { const [password, setPassword] = useState(''); const handleSubmit = (event) => { event.preventDefault(); onLogin(password); }; return (
); }; export default App;