import type { PublicPaperSummary } from "@autoscholar/schemas";
import Link from "next/link";
import { disciplineLabel, fmtDate, modeLabel } from "@/lib/format";
import { IconArrow, IconCode, IconData, IconDoc } from "./Icons";
import { StatusBadge } from "./StatusBadge";
function Avail({ p }: { p: PublicPaperSummary }) {
const items: Array<[boolean, string, React.ReactNode]> = [
[true, "PDF", ],
[
p.hasLatex,
"LaTeX",
TeX
,
],
[p.hasCode, "Code", ],
[p.hasData, "Data", ],
];
return (
{items
.filter(([ok]) => ok)
.map(([, label, icon]) => (
-
{icon}
{label}
))}
);
}
/** ResearchPaperCard — premium publication card. `variant="row"` is denser for lists; `featured` is the editorial lead. */
export function PaperCard({
p,
featured = false,
variant = "card",
index,
}: {
p: PublicPaperSummary;
featured?: boolean;
variant?: "card" | "row";
index?: number;
}) {
const href = `/research/${p.slug}`;
const delay = index !== undefined ? `reveal reveal-${Math.min(4, (index % 4) + 1)}` : "";
if (featured) {
return (
{p.publicId}
Featured
{disciplineLabel(p.discipline)} · {modeLabel(p.researchMode)}
{p.status !== "published" && }
{p.synthetic && staging sample}
{p.title}
{p.abstract}
- Released
- {fmtDate(p.firstPublishedAt)}
- Version
- v{p.versionNo}
- Keywords
-
{p.keywords.slice(0, 5).map((k) => (
{k}
))}
);
}
if (variant === "row") {
return (
{p.publicId}
{fmtDate(p.firstPublishedAt)} · v{p.versionNo}
{disciplineLabel(p.discipline)} · {modeLabel(p.researchMode)}
{p.status !== "published" && }
{p.synthetic && staging sample}
{p.title}
{p.abstract}
{p.keywords.slice(0, 4).map((k) => (
-
{k}
))}
);
}
return (
{p.publicId}
{disciplineLabel(p.discipline)} · {modeLabel(p.researchMode)}
{p.status !== "published" && }
{p.synthetic && staging sample}
{p.title}
{p.abstract}
{fmtDate(p.firstPublishedAt)} · v{p.versionNo}
);
}
export { PaperCard as ResearchPaperCard };
export function FeaturedPaper({ p }: { p: PublicPaperSummary }) {
return ;
}