// src/MainRouter.jsx
import React, { useState } from 'react';
import { Routes, Route } from 'react-router-dom';
import App from './App';
import HelpEditor from './HelpEditor';
import LoginForm from './LoginForm';

export default function MainRouter() {
  const [isAuthenticated, setIsAuthenticated] = useState(false);

  return (
    <Routes>
      <Route path="/" element={<App />} />
      <Route
        path="/editor"
        element={
          isAuthenticated ? (
            <HelpEditor />
          ) : (
            <LoginForm onLogin={() => setIsAuthenticated(true)} />
          )
        }
      />
    </Routes>
  );
}

