import { listCategories } from "@lib/data/categories"
import { listCollections } from "@lib/data/collections"
import { Text, clx } from "@medusajs/ui"
import LocalizedClientLink from "@modules/common/components/localized-client-link"
import MedusaCTA from "@modules/layout/components/medusa-cta"
import { DynamicLayoutRenderer } from "@vibentec/renderer"
import {
  LayoutComponentDefinition,
  LayoutContext,
} from "vibentec/component-map"

export default async function VtFooter({
  nodes,
  context,
}: {
  nodes?: LayoutComponentDefinition
  context: LayoutContext
}) {
  const { collections } = await listCollections({
    fields: "*products",
  })
  const productCategories = await listCategories()
  const props = nodes?.config ?? {}

  return (
    <footer className="relative mx-auto duration-200 bg-white border-ui-border-base border-t-2">
      {props.children && <DynamicLayoutRenderer nodes={props.children} context={context} />}
    </footer>
  )
}
