SPB Git

spb/cancerindex

Public
1.7 KB · 43 lines tsx
1import Link from 'next/link';2import { Badge } from '@/components/ui/badge';3import type { PublicationRow } from '@/lib/queries/publications';4import { fmtDate } from '@/lib/format';56export function PublicationList({ rows }: { rows: Array<PublicationRow & { method?: string; edge_status?: string }> }) {7  return (8    <ol className="divide-y divide-rule">9      {rows.map((p) => (10        <li key={p.id} className="py-2.5 text-[13.5px]">11          <div className="flex flex-wrap items-baseline gap-x-2">12            {p.pmid ? (13              <Link href={`/publication/${p.pmid}`} className="ci-link font-medium">14                {p.title}15              </Link>16            ) : (17              <span className="font-medium">{p.title}</span>18            )}19            {p.retracted ? <Badge tone="danger">Retracted</Badge> : null}20            {p.is_preprint ? <Badge tone="warn">Preprint</Badge> : null}21          </div>22          <p className="mt-0.5 text-[12.5px] text-ink-3">23            {p.authors24              .slice(0, 3)25              .map((a) => a.name)26              .join(', ')}27            {p.authors.length > 3 ? ' et al.' : ''}28            {p.journal_iso || p.journal ? ` · ${p.journal_iso ?? p.journal}` : ''}29            {p.pub_date ? ` · ${fmtDate(p.pub_date)}` : p.pub_year ? ` · ${p.pub_year}` : ''}30            {p.pmid ? <span className="ci-mono"> · PMID {p.pmid}</span> : null}31            {p.edge_status ? (32              <>33                {' '}34                · <Badge tone={p.edge_status === 'validated' ? 'ok' : 'warn'}>{p.edge_status}</Badge> {p.method ? <span className="ci-mono">{p.method}</span> : null}35              </>36            ) : null}37          </p>38        </li>39      ))}40    </ol>41  );42}43
Files · 36d464dcc8d9fe84217ecbfd89a225759f5f0c06
Menu

Theme