import { Routes, Route, Navigate } from 'react-router-dom'
import { AuthProvider, useAuth } from './hooks/useAuth'
import Layout from './components/Layout'
import SusiPage from './pages/SusiPage'
import LoginKeypadPage from './pages/LoginKeypadPage'
import SignupKeypadPage from './pages/SignupKeypadPage'
import HomePage from './pages/HomePage'
import NotFoundPage from './pages/NotFoundPage'
function ProtectedRoute({ children }: { children: React.ReactNode }) {
const { isAuthenticated } = useAuth()
if (!isAuthenticated) return
return <>{children}>
}
function GuestRoute({ children }: { children: React.ReactNode }) {
const { isAuthenticated } = useAuth()
if (isAuthenticated) return
return <>{children}>
}
export default function App() {
return (
}>
{/* Guest routes */}
} />
} />
} />
{/* Protected routes */}
} />
{/* 404 */}
} />
)
}