-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouter.tsx
More file actions
40 lines (33 loc) · 1.48 KB
/
Copy pathRouter.tsx
File metadata and controls
40 lines (33 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React, { lazy, Suspense } from 'react';
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
// Import supabase para garantir que está inicializado
import './lib/supabase';
// Lazy load pages
const App = lazy(() => import('./App'));
const LandingPage = lazy(() => import('./pages/vendas/LandingPage'));
const ThankYouPage = lazy(() => import('./pages/vendas/ThankYouPage'));
const ResetPasswordPage = lazy(() => import('./pages/auth/ResetPasswordPage'));
const ConfirmEmailPage = lazy(() => import('./pages/auth/ConfirmEmailPage'));
// Fallback simples (tela preta) para não duplicar animação com App.tsx
const SimpleFallback = () => <div className="min-h-screen bg-black" />;
const AppRouter: React.FC = () => {
return (
<BrowserRouter>
<Suspense fallback={<SimpleFallback />}>
<Routes>
{/* Landing Page - Sales Pages */}
<Route path="/vendas" element={<LandingPage />} />
<Route path="/pagina-vendas" element={<LandingPage />} />
{/* Thank You Page - Redirects back to app after success */}
<Route path="/obrigado" element={<ThankYouPage />} />
{/* Auth Pages */}
<Route path="/reset-password" element={<ResetPasswordPage />} />
<Route path="/confirm-email" element={<ConfirmEmailPage />} />
{/* Main App - Default Route */}
<Route path="/*" element={<App />} />
</Routes>
</Suspense>
</BrowserRouter>
);
};
export default AppRouter;