UNPKG

@prokodo/ui

Version:

UI components for production-grade Next.js + Headless CMS (Strapi, Contentful, Headless WordPress) websites by prokodo – built for Core Web Vitals & SEO.

24 lines (23 loc) 620 B
"use client"; import { jsx } from "react/jsx-runtime"; import { memo } from "react"; import BaseLinkServer from "../base-link/BaseLink.server.js"; import { LinkView } from "./Link.view.js"; const LinkClient = memo((props) => { const { href, onClick } = props; const linkTag = onClick && !href ? "span" : "a"; const hasHandlers = Boolean(onClick) || Boolean(props.onKeyDown); return /* @__PURE__ */ jsx( LinkView, { ...props, BaseLinkComponent: BaseLinkServer, hasHandlers, LinkTag: linkTag } ); }); LinkClient.displayName = "LinkClient"; export { LinkClient as default };