26 lines
558 B
TypeScript
26 lines
558 B
TypeScript
"use client";
|
|
|
|
import { GoogleOAuthProvider } from "@react-oauth/google";
|
|
import { AuthProvider } from "@/contexts/AuthContext";
|
|
import { ReactNode } from "react";
|
|
|
|
export function Providers({ children }: { children: ReactNode }) {
|
|
const googleClientId = process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID || '';
|
|
|
|
const content = (
|
|
<AuthProvider>
|
|
{children}
|
|
</AuthProvider>
|
|
);
|
|
|
|
if (googleClientId) {
|
|
return (
|
|
<GoogleOAuthProvider clientId={googleClientId}>
|
|
{content}
|
|
</GoogleOAuthProvider>
|
|
);
|
|
}
|
|
|
|
return content;
|
|
}
|