"use client";

import type { Session } from "@supabase/supabase-js";
import { SessionContextProvider } from "@supabase/auth-helpers-react";
import { supabaseBrowser } from "@/lib/supabase/client";

interface SupabaseProviderProps {
  session: Session | null;
  children: React.ReactNode;
}

export function SupabaseProvider({ session, children }: SupabaseProviderProps) {
  return (
    <SessionContextProvider supabaseClient={supabaseBrowser} initialSession={session}>
      {children}
    </SessionContextProvider>
  );
}
