import { Routes, Route, Navigate } from 'react-router-dom'
import { LoginPage } from '../pages/LoginPage'
import { SetupPage } from '../pages/SetupPage'
import { HomePage } from '../pages/HomePage'
import { EditorPage } from '../pages/EditorPage'
import { AuthGuard } from '../features/auth/AuthGuard'

export function App() {
  return (
    <Routes>
      <Route path="/login" element={
        <AuthGuard>
          <LoginPage />
        </AuthGuard>
      } />
      <Route path="/setup" element={
        <AuthGuard>
          <SetupPage />
        </AuthGuard>
      } />
      
      {/* Protected Routes */}
      <Route path="/" element={
        <AuthGuard>
          <HomePage />
        </AuthGuard>
      } />
      <Route path="/editor/:id" element={
        <AuthGuard>
          <EditorPage />
        </AuthGuard>
      } />
      
      <Route path="*" element={<Navigate to="/" replace />} />
    </Routes>
  )
}
