function BreadcrumbsItemLink()

in src/theme/DocBreadcrumbs/index.tsx [15:55]


function BreadcrumbsItemLink({
  children,
  href,
  isLast,
}: {
  children: ReactNode;
  href: string | undefined;
  isLast: boolean;
}): JSX.Element {
  const className = "breadcrumbs__link";
  if (isLast) {
    return (
      <span className={className} itemProp="name">
        {children}
      </span>
    );
  }
  const navF = useNavToTarget();
  return href ? (
    <span
      className={className}
      style={{
        cursor: "pointer",
      }}
      onClick={() => {
        navF(href);
      }}
    >
      {children}
    </span>
  ) : (
    // TODO Google search console doesn't like breadcrumb items without href.
    // The schema doesn't seem to require `id` for each `item`, although Google
    // insist to infer one, even if it's invalid. Removing `itemProp="item
    // name"` for now, since I don't know how to properly fix it.
    // See https://github.com/facebook/docusaurus/issues/7241
    <span className={className} id="支付">
      {children}
    </span>
  );
}