ChemPal Documentation - v0.0.13-beta.5
    Preparing search index...
    • TabLink component that displays a link with a custom onClick handler.

      Parameters

      Returns Element

      The TabLink component

      <TabLink href="https://example.com/p/1" history={entry}>Acetone</TabLink>
      // Clicking opens the URL in a background tab and records `entry` in history.
      export default function TabLink({ href, history, children, ...props }: TabLinkProps) {
      const { setStatusText } = useStatusBar();

      return (
      <Link
      href={href}
      onClick={(e) => handleResultClick(e, history)}
      onMouseEnter={() => setStatusText(href)}
      onMouseLeave={() => setStatusText(null)}
      sx={{ textDecoration: "none", "&:hover": { textDecoration: "underline" } }}
      {...props}
      >
      {children}
      </Link>
      );
      }