import { useState, useEffect } from "react";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import AuthRegister from "./pages/Auth/AuthRegister";
import AuthLogin from "./pages/Auth/AuthLogin";
import EmailVerification from "./pages/Auth/EmailVerification";
import Test from "./pages/Testing/Test";


function App() {
  const [isMobile, setIsMobile] = useState(false);

  useEffect(() => {
    const handleResize = () => {
      setIsMobile(window.innerWidth <= 1280);
    };

    handleResize();
    window.addEventListener("resize", handleResize);

    return () => window.removeEventListener("resize", handleResize);
  }, []);

  // if (isMobile) {
  //   return (
  //     <Router>
  //       <Routes>
  //         <Route path="/register" element={<AuthRegister />} />
  //         <Route path="/login" element={<AuthLogin />} />
  //         <Route path="/verify-email" element={<EmailVerification />} />
  //       </Routes>
  //     </Router>
  //   );
  // }

  return (
    <Router>
      <Routes>
        <Route path="/register" element={<AuthRegister />} />
        <Route path="/login" element={<AuthLogin />} />
        <Route path="/verify-email" element={<EmailVerification />} />
        <Route path="/test" element={<Test />} />
      </Routes>
    </Router>
  );
}

export default App;