mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-11 11:43:54 +03:00
b0514d6149
* add libraries for traslation purposes * Add button and service for language selection * add spanish translation on login page * add spanish translation on upload page * Add spanish translations for explore page * Add translations on user page * Add translations for config page * Add spanish translations on chat page * add translations for brain page * fix GUI and save on local storage * fix (i18n) init and types * fix (i18n): typos * add translation on new brain modal * add translations on metadata * Add translations on home page * fixes types * fix(frontend-tests): use get by id instead of text --------- Co-authored-by: Gustavo Maciel <gustavo_m13@outlook.com>
33 lines
1018 B
TypeScript
33 lines
1018 B
TypeScript
"use client";
|
|
|
|
import { PropsWithChildren, useEffect } from "react";
|
|
|
|
import Footer from "@/lib/components/Footer";
|
|
import { NavBar } from "@/lib/components/NavBar";
|
|
import { TrackingWrapper } from "@/lib/components/TrackingWrapper";
|
|
import { useBrainContext } from "@/lib/context/BrainProvider/hooks/useBrainContext";
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
import '../lib/config/LocaleConfig/i18n'
|
|
import { UpdateMetadata } from "@/lib/helpers/updateMetadata";
|
|
|
|
// This wrapper is used to make effect calls at a high level in app rendering.
|
|
export const App = ({ children }: PropsWithChildren): JSX.Element => {
|
|
const { fetchAllBrains, fetchAndSetActiveBrain } = useBrainContext();
|
|
const { session } = useSupabase();
|
|
|
|
useEffect(() => {
|
|
void fetchAllBrains();
|
|
void fetchAndSetActiveBrain();
|
|
}, [session?.user]);
|
|
|
|
return (
|
|
<>
|
|
<TrackingWrapper />
|
|
<NavBar />
|
|
<div className="flex-1">{children}</div>
|
|
<Footer />
|
|
<UpdateMetadata />
|
|
</>
|
|
);
|
|
};
|