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 (
No content availableInsta Local