Skip to documentation

Design system / Sources & standards

Current repository source

roundStatsStrip.tsx

src/app/(tenants)/console/[tenantCode]/admin/programs/[programCode]/editions/[editionCode]/review-rounds/components/roundStatsStrip.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 { Skeleton } from "@/components/ui/skeleton";
import type { EditionRoundSubmission } from "../reviewRoundsApi";
import { FileText } from "lucide-react";

type RoundStatsStripProps = {
  submissionLabelPlural?: string;
  submissions: EditionRoundSubmission[];
  loading: boolean;
  unavailable?: boolean;
};

export function RoundStatsStrip({ submissions, loading, unavailable = false, submissionLabelPlural = "Submissions" }: RoundStatsStripProps) {
  if (loading) {
    return <Skeleton className="h-5 w-full" />;
  }
  if (unavailable) {
    return <p className="text-supporting text-muted-foreground">Review statistics unavailable.</p>;
  }

  const scored = submissions.filter((sub) => sub.scores.length > 0);
  const advanced = submissions.filter((sub) => sub.isShortlisted);

  const stats = [
    { label: submissionLabelPlural, value: `${submissions.length}` },
    { label: "Scored", value: `${scored.length} / ${submissions.length}` },
    { label: "Advanced", value: `${advanced.length} / ${submissions.length}` },
  ];

  return (
    <div>
      <dl className="flex flex-wrap gap-x-4 gap-y-2 text-supporting">
        {stats.map((stat) => (
          <div key={stat.label} className="flex items-center gap-1">
            <dt className="flex items-center gap-2 text-muted-foreground">{stat.label === submissionLabelPlural ? <FileText aria-hidden className="size-4 shrink-0" /> : null}{stat.label}:</dt>
            <dd className="font-medium">{stat.value}</dd>
          </div>
        ))}
      </dl>
    </div>
  );
}
All sources and standards
Current components and theme tokens. Fictional example data. Source views refresh on deployment; authors maintain contract notes.