mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
18f76a5341
* 🔥 Remove Chat page intro (component and translations)
* Centered full-size chat window (partial)
* fix: gray background when adding a document
* chat window: responsive padding
* cleaner navbar display condition
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
import { PropsWithChildren, useEffect } from "react";
|
|
|
|
import Footer from "@/lib/components/Footer";
|
|
import { NavBar } from "@/lib/components/NavBar";
|
|
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
import { UpdateMetadata } from "@/lib/helpers/updateMetadata";
|
|
import { usePageTracking } from "@/services/analytics/june/usePageTracking";
|
|
import "../lib/config/LocaleConfig/i18n";
|
|
|
|
const queryClient = new QueryClient();
|
|
|
|
// This wrapper is used to make effect calls at a high level in app rendering.
|
|
export const App = ({ children }: PropsWithChildren): JSX.Element => {
|
|
const { fetchAllBrains, fetchDefaultBrain, fetchPublicPrompts } =
|
|
useBrainContext();
|
|
const { session } = useSupabase();
|
|
|
|
usePageTracking();
|
|
|
|
useEffect(() => {
|
|
if (session?.user) {
|
|
void fetchAllBrains();
|
|
void fetchDefaultBrain();
|
|
void fetchPublicPrompts();
|
|
}
|
|
}, [session]);
|
|
|
|
return (
|
|
<QueryClientProvider client={queryClient}>
|
|
<NavBar />
|
|
{children}
|
|
<Footer />
|
|
<UpdateMetadata />
|
|
</QueryClientProvider>
|
|
);
|
|
};
|