Skip to the content

Capsid menu

app/components/admin/tab-link.tsx

24 lines and 1 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.

Functions

The functions of tab-link.tsx
FunctionLinesComplexityCoveredCRAPMutation
TabLink5 to 253No data: no coverage report in this mapNo data: no coverage report in this mapNo data: no mutants in this code

Imports

It imports no other module of this repo. Imported by app/components/admin/media-display-bar.tsx, app/components/admin/media-display-group.tsx, app/components/admin/media-facets.tsx, app/components/admin/posts-filters.tsx, app/routes/admin.kb.tsx, app/routes/admin.mentions.tsx.

Source

import type { ReactNode } from "react";
import { Link } from "react-router";

/** Capsomer's tab-link markup on the router's Link, so a filter tab navigates without a page load. */
export function TabLink({
  to,
  current,
  count,
  children,
  ...rest
}: {
  to: string;
  current?: boolean;
  count?: number;
  children: ReactNode;
  "aria-label"?: string;
  title?: string;
}) {
  return (
    <Link to={to} className="cap-tab" aria-current={current ? "page" : undefined} {...rest}>
      {children}
      {count != null ? <span className="cap-tab-count">{count}</span> : null}
    </Link>
  );
}