"use client" import { LayoutComponentDefinition, LayoutContext, } from "@vibentec/component-map" import LocalizedClientLink from "@modules/common/components/localized-client-link" import * as MedusaIcons from "@medusajs/icons" import * as CustomIcons from "@modules/common/icons" export default function VtMenuItem({ nodes, context, }: { nodes: LayoutComponentDefinition context: LayoutContext }) { const props = nodes.config ?? {} const title = props.title ?? "" const items = props.items ?? [] const icon = props.icon ?? "" const getIconComponent = (icon: string | undefined) => { return icon ? (MedusaIcons as Record)[icon] ?? (CustomIcons as Record)[icon] : undefined } return (
{title}
    {items.map((item: { text: string; href?: string; icon?: string }, index: number) => { const Icon = getIconComponent(item.icon) return (
  • {Icon && } {item.href ? ( {item.text} ) : ( {item.text} )}
  • ) })}
) }