Skip to the content

Capsid menu

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

The functions of project-tabs.tsx
FunctionLinesComplexityCoveredCRAPMutation
ProjectTabs16 to 2610%OkCRAP 2No data: mutation testing has not run on this repo yet
<anonymous:19>19 to 1920%WatchCRAP 6No data: mutation testing has not run on this repo yet
<anonymous:19>19 to 2320%WatchCRAP 6No 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>
  );
}