app/components/project-tabs.tsx
23 lines and 3 functions in DrDustinEdwards/carrel, at commit d5d5e82 on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| ProjectTabs | 16 to 26 | 1 | 0% | OkCRAP 2 | No data: mutation testing has not run on this repo yet |
| <anonymous:19> | 19 to 19 | 2 | 0% | WatchCRAP 6 | No data: mutation testing has not run on this repo yet |
| <anonymous:19> | 19 to 23 | 2 | 0% | WatchCRAP 6 | No data: mutation testing has not run on this repo yet |
Imports
It imports no other module of this repo. Imported by app/routes/legal.tsx, app/routes/media.tsx, app/routes/mentions.tsx, app/routes/project.flags.tsx, app/routes/project.tsx, app/routes/project.voice.tsx.
Source
// The sections of a site project, as Capsomer's link tabs: each is a page of its own, so each is a link.
import { Link } from "react-router";
import { TabsNav } from "capsomer/react/tabs";
const SECTIONS = [
{ id: "posts", label: "Posts", path: "" },
{ id: "media", label: "Media", path: "/media" },
{ id: "legal", label: "Legal", path: "/legal" },
{ id: "mentions", label: "Mentions", path: "/mentions" },
{ id: "flags", label: "Flags", path: "/flags" },
{ id: "voice", label: "Voice", path: "/voice" },
] as const;
/** `mentions` says whether this person may see the Mentions tab: the queue is the Owner's alone (roles.ts). */
export function ProjectTabs({ slug, current, mentions = false }: { slug: string; current: (typeof SECTIONS)[number]["id"]; mentions?: boolean }) {
return (
<TabsNav aria-label={`Sections of this project`} variant="line">
{SECTIONS.filter((s) => s.id !== "mentions" || mentions).map((s) => (
<Link key={s.id} to={`/p/${slug}${s.path}`} className="cap-tab" aria-current={s.id === current ? "page" : undefined}>
{s.label}
</Link>
))}
</TabsNav>
);
}