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
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| TabLink | 5 to 25 | 3 | No data: no coverage report in this map | No data: no coverage report in this map | No 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>
);
}