"use client"
import {
  LayoutComponentDefinition,
  LayoutContext,
} from "@vibentec/component-map"
import { DefaultCtaBanner } from "./default-cta"
import { BearCtaBanner } from "./bear-cta"

export function VtCtaBanner({
  nodes,
  context,
}: {
  nodes: LayoutComponentDefinition
  context: LayoutContext
}) {
  const props = nodes.config ?? {}
  const variant = props.variant ?? "default"

  const variants: Record<string, any> = {
    default: DefaultCtaBanner,
    "3bear": BearCtaBanner,
  }

  const Component = variants[variant] || DefaultCtaBanner

  return <Component nodes={nodes} context={context} />
}
