~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/pds.js

An atproto PDS in JavaScript, for Cloudflare Workers and Node

0
0
main
23 lines · 764 B Raw History
import { Link as RouterLink } from '@tanstack/react-router';
import { cn } from '#/lib/utils.js';

/**
 * An in-app anchor. It is a real href so the link opens in a new tab and
 * reads correctly to a crawler, and a plain click routes without a reload.
 * The router starts the route's loads when the pointer settles on it, so
 * the page behind a link is often in hand before the click. A `search`
 * object, where the link opens a repository in a space, joins the address.
 */
export function Link({ href, search, className, children, ...props }) {
  return (
    <RouterLink
      to={href}
      search={search}
      preload="intent"
      className={cn('text-key hover:underline', className)}
      {...props}
    >
      {children}
    </RouterLink>
  );
}