import { Routes, Route, Navigate } from 'react-router-dom';
import { usePwaRegister } from './hooks/usePwaRegister';
import { LoginPage } from './pages/LoginPage';
import { IndexPage } from './pages/IndexPage';
import { AddAccountPage } from './pages/AddAccountPage';
import { EditAccountPage } from './pages/EditAccountPage';

export default function App() {
  usePwaRegister();
  return (
    <div className="app-shell">
      <Routes>
        <Route path="/login" element={<LoginPage />} />
        <Route path="/" element={<IndexPage />} />
        <Route path="/add" element={<AddAccountPage />} />
        <Route path="/edit/:id" element={<EditAccountPage />} />
        <Route path="*" element={<Navigate to="/" replace />} />
      </Routes>
    </div>
  );
}
