import StaticMapPrimitive from "@scandic-hotels/design-system/StaticMap"

import { env } from "../../env/server"

import type { ComponentProps } from "react"

type Props = Omit<
  ComponentProps<typeof StaticMapPrimitive>,
  "googleMapKey" | "googleMapSecret"
>
export async function StaticMap(props: Props) {
  const key = env.GOOGLE_STATIC_MAP_KEY
  const secret = env.GOOGLE_STATIC_MAP_SIGNATURE_SECRET

  return (
    <StaticMapPrimitive
      {...props}
      googleMapKey={key}
      googleMapSecret={secret}
    />
  )
}
