página de login
This commit is contained in:
@@ -1,12 +1,32 @@
|
||||
// App.tsx
|
||||
import React from 'react';
|
||||
import { Toaster } from 'react-hot-toast';
|
||||
import SinglePageDataRequestIntegrated from './components/SinglePageDataRequestIntegrated';
|
||||
import { AuthProvider, useAuth } from './utils/AuthContext';
|
||||
import LoginPage from './components/LoginPage';
|
||||
|
||||
const AppContent: React.FC = () => {
|
||||
const { isAuthenticated } = useAuth();
|
||||
|
||||
return (
|
||||
<>
|
||||
{isAuthenticated ? (
|
||||
<SinglePageDataRequestIntegrated />
|
||||
) : (
|
||||
<LoginPage />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const App: React.FC = () => {
|
||||
return (
|
||||
<main className="min-h-screen">
|
||||
<SinglePageDataRequestIntegrated />
|
||||
</main>
|
||||
<AuthProvider>
|
||||
<Toaster position="top-right" />
|
||||
<AppContent />
|
||||
</AuthProvider>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user