mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 01:21:48 +03:00
430ab54479
* feat(ShareableBrain): add get brain users endpoints * feat(sdk): add getBrainUsers * feat(ShareableBrain): display users with access * feat: rename role to rights * fix(Brain): fecth brains on auth status change
30 lines
889 B
TypeScript
30 lines
889 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";
|
|
|
|
// 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 />
|
|
</>
|
|
);
|
|
};
|