twenty/front/src/App.tsx

48 lines
1.1 KiB
TypeScript
Raw Normal View History

import React from 'react';
import Inbox from './pages/inbox/Inbox';
import Contacts from './pages/Contacts';
import Insights from './pages/Insights';
2023-01-27 14:12:04 +03:00
import AuthCallback from './pages/AuthCallback';
import AppLayout from './layout/AppLayout';
2023-01-27 14:12:04 +03:00
import RequireAuth from './components/RequireAuth';
2022-12-02 14:39:15 +03:00
import { Routes, Route } from 'react-router-dom';
import { useGetProfile } from './hooks/profile/useGetProfile';
2022-12-01 17:58:08 +03:00
function App() {
const { user } = useGetProfile();
2023-01-27 14:12:04 +03:00
2022-12-01 17:58:08 +03:00
return (
2023-01-27 14:12:04 +03:00
<AppLayout user={user}>
2022-12-02 14:39:15 +03:00
<Routes>
2023-01-27 14:12:04 +03:00
<Route
path="/"
element={
<RequireAuth>
<Inbox />
</RequireAuth>
}
/>
<Route
path="/contacts"
element={
<RequireAuth>
<Contacts />
</RequireAuth>
}
/>
<Route
path="/insights"
element={
<RequireAuth>
<Insights />
</RequireAuth>
}
/>
<Route path="/auth/callback" element={<AuthCallback />} />
2022-12-02 14:39:15 +03:00
</Routes>
</AppLayout>
2022-12-01 17:58:08 +03:00
);
}
export default App;