mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
LayoutContent
This commit is contained in:
parent
fc6c1f0de6
commit
4e7a19baa0
1 changed files with 12 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import { ThemeProvider } from "@/contexts/ThemeContext";
|
|||
import Sidebar2 from "@/app/(dashboard)/components/Sidebar2";
|
||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
||||
import { useRouter, useSearchParams } from "next/navigation";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
|
||||
/** ---- BASE URL HELPERS ---- */
|
||||
function normalizeBasePrefix(raw: string | undefined | null): string {
|
||||
|
|
@ -22,7 +23,7 @@ function withBase(path: string): string {
|
|||
}
|
||||
/** -------------------------------- */
|
||||
|
||||
function LayoutContent({ children }: { children: React.ReactNode }) {
|
||||
function DashboardContent({ children }: { children: React.ReactNode }) {
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const { accessToken, userRole, userId, userEmail, premiumUser } = useAuthorized();
|
||||
|
|
@ -72,6 +73,16 @@ function LayoutContent({ children }: { children: React.ReactNode }) {
|
|||
);
|
||||
}
|
||||
|
||||
function LayoutContent({ children }: { children: React.ReactNode }) {
|
||||
const [queryClient] = useState(() => new QueryClient());
|
||||
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<DashboardContent>{children}</DashboardContent>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Layout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<Suspense fallback={<div className="flex items-center justify-center min-h-screen">Loading...</div>}>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue