"use client";

import { createContext, type ReactNode } from "react";
import type { UserInfo } from "@/lib/types";

export const UserContext = createContext<UserInfo>({
  email: "",
  name: "",
});

export function UserProvider({
  email,
  name,
  children,
}: UserInfo & { children: ReactNode }) {
  return (
    <UserContext value={{ email, name }}>
      {children}
    </UserContext>
  );
}
