"use client"
import { APIProvider } from "@vis.gl/react-google-maps"

import { type PageTypeContextType, PageTypeProvider } from "./PageTypeProvider"

import type { PropsWithChildren } from "react"

interface MapContainerProps {
  apiKey: string
  pageType: PageTypeContextType
}

export default function MapProvider({
  apiKey,
  children,
  pageType,
}: PropsWithChildren<MapContainerProps>) {
  return (
    <APIProvider apiKey={apiKey}>
      <PageTypeProvider value={pageType}>{children}</PageTypeProvider>
    </APIProvider>
  )
}
