import React, { useState } from 'react'; import { BrowserRouter, Routes, Route } from 'react-router-dom'; import CircularProgress from '@mui/material/CircularProgress'; import Snackbar from '@mui/material/Snackbar'; import Alert from '@mui/material/Alert'; import logo from './Icons/settings-2.svg'; import './App.css'; import IntialSetting from './Components/IntialSetting.js'; import AiPage from './Components/AiPage.js'; function App() { return ( } /> } /> ); } function Home() { const [showSettings, setShowSettings] = useState(false); const [initializing, setInitializing] = useState(false); // Snackbar state const [snackbar, setSnackbar] = useState({ open: false, message: "", severity: "success", }); const handleInitializationStart = () => { setInitializing(true); }; // Function to open the snackbar const openSnackbar = (message, severity = "success") => { setSnackbar({ open: true, message, severity }); }; // Function to close the snackbar const closeSnackbar = (event, reason) => { if (reason === 'clickaway') return; setSnackbar(prev => ({ ...prev, open: false })); }; return (
{initializing ? ( <>

Initializing the app. This may take a few minutes...

) : ( <> logo setShowSettings(true)} style={{ cursor: 'pointer' }} />

Enter the settings to proceed

)} {/* InitialSetting */} {showSettings && ( )}
{/* Render the Snackbar*/} {snackbar.message}
); } export default App;