Skip to documentation
Design system / Sources & standards
Current repository source
roundListItem.tsx
src/app/(tenants)/console/[tenantCode]/admin/programs/[programCode]/editions/[editionCode]/review-rounds/components/roundListItem.tsx
This view contains the escaped source read during the deployment build. Code and policy text are unchanged. Markdown is shown as source, not rendered as a document. A new deployment refreshes the content.
"use client";
import Link from "next/link";
import { GripVertical } from "lucide-react";
import { SortableRoundItem } from "@/components/review-rounds/sortableRoundList";
import { cn } from "@/lib/utils";
import type { RoundData } from "../types";
type RoundListItemProps = {
round: RoundData;
href: string;
isActive: boolean;
editing: boolean;
compact?: boolean;
number?: number;
};
export function RoundListItem({ round, href, isActive, editing, compact = false, number }: RoundListItemProps) {
return (
<SortableRoundItem
id={round.id}
disabled={!editing}
className={cn(
"group flex items-center gap-1 rounded-md border transition-colors",
isActive ? "border-primary/50 bg-primary/5" : "border-transparent hover:bg-muted/50",
)}
>
{({ ref, attributes, listeners }) => <>
{editing && <button
type="button"
ref={ref}
{...attributes}
{...listeners}
className="shrink-0 cursor-grab touch-none rounded p-1.5 text-muted-foreground hover:text-foreground active:cursor-grabbing"
aria-label={`Reorder ${round.name}`}
>
<GripVertical className="h-4 w-4" />
</button>}
<Link href={href} className="min-w-0 flex-1 p-3" aria-current={isActive ? "page" : undefined} aria-label={number ? `Round ${number}: ${round.name}` : undefined} title={round.name}>
{number && !editing ? <span className={`${compact ? "block" : "block md:hidden"} text-center text-label font-semibold`} aria-hidden>{number}</span> : null}
<div className={compact ? "sr-only" : `${number && !editing ? "hidden md:flex" : "flex"} flex-wrap items-center gap-2`}>
<span className="text-label truncate font-medium">{round.name}</span>
<span
className={cn(
"inline-flex shrink-0 items-center rounded-full px-1.5 py-0.5 text-eyebrow font-medium uppercase tracking-wide",
round.status === "active" ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground",
)}
>
{round.status}
</span>
</div>
<p className={compact ? "sr-only" : `${number && !editing ? "hidden md:block" : "block"} truncate text-supporting text-muted-foreground`}>
{round.reviewers.length} {(round.reviewers.length === 1 ? round.reviewerLabel ?? "Reviewer" : round.reviewerLabelPlural ?? "Reviewers").toLowerCase()}
</p>
</Link>
</>}
</SortableRoundItem>
);
}
All sources and standards