import LocalizedClientLink from "@modules/common/components/localized-client-link"
import { LayoutComponentDefinition, LayoutContext } from "vibentec/component-map";
import { clx } from "@medusajs/ui"
 
export const HomeButton = ({ nodes, context }: { nodes: LayoutComponentDefinition; context: LayoutContext }) => {
  const props = nodes.config ?? {}
  const className = clx("txt-compact-xlarge-plus hover:text-ui-fg-base uppercase", props.className)
  const href = props.href ?? "/"
  const label = props.label ?? "Medusa Store"

  return (
    <div className="flex items-center h-full">
      <LocalizedClientLink
        href={href}
        className={className}
        data-testid="nav-store-link"
      >
        {label}
      </LocalizedClientLink>
  </div>
  )
}

export default HomeButton