import { listRegions, getRegion } from "@lib/data/regions"
import { HttpTypes } from "@medusajs/types"
import {
  LayoutComponentDefinition,
  LayoutContext,
} from "@vibentec/component-map"
import VtCountryCodeSelectClient from "./index"

export default async function VtCountryCodeSelect({
  nodes,
  context,
}: {
  nodes: LayoutComponentDefinition
  context: LayoutContext
}) {
  const regions = (await listRegions()) as HttpTypes.StoreRegion[]

  return (
    <VtCountryCodeSelectClient nodes={nodes} context={context} regions={regions} />
  )
}

