mirror of
https://github.com/willchen96/mike.git
synced 2026-07-24 23:41:04 +02:00
26 lines
865 B
TypeScript
26 lines
865 B
TypeScript
"use client";
|
|
|
|
import { Suspense } from "react";
|
|
import { AuthProvider } from "@/app/contexts/AuthContext";
|
|
import { UserProfileProvider } from "@/app/contexts/UserProfileContext";
|
|
import { MfaLoginGate } from "@/app/components/shared/MfaLoginGate";
|
|
|
|
export function Providers({ children }: { children: React.ReactNode }) {
|
|
return (
|
|
<AuthProvider>
|
|
<UserProfileProvider>
|
|
<Suspense fallback={<ProviderLoader />}>
|
|
<MfaLoginGate>{children}</MfaLoginGate>
|
|
</Suspense>
|
|
</UserProfileProvider>
|
|
</AuthProvider>
|
|
);
|
|
}
|
|
|
|
function ProviderLoader() {
|
|
return (
|
|
<div className="flex min-h-dvh items-center justify-center bg-gray-50/80">
|
|
<div className="h-6 w-6 animate-spin rounded-full border-2 border-gray-200 border-t-gray-700" />
|
|
</div>
|
|
);
|
|
}
|