--- import { type HeroProps, type Author, normalizeAuthors, getLinkIcon, } from "./heroUtils"; const { title, description, authors = [], affiliations = [], affiliation, published, links = [], } = Astro.props as HeroProps; const normalizedAuthors: Author[] = normalizeAuthors(authors as any); const authorAffiliationIndexSet = new Set(); for (const author of normalizedAuthors) { const indices = Array.isArray(author.affiliationIndices) ? author.affiliationIndices : []; for (const idx of indices) { if (typeof idx === "number") authorAffiliationIndexSet.add(idx); } } const shouldShowAffiliationSupers = authorAffiliationIndexSet.size > 1; // Resolve affiliations: prefer array, fallback to legacy string const resolvedAffiliations = Array.isArray(affiliations) && affiliations.length > 0 ? affiliations : affiliation ? [{ id: 1, name: affiliation }] : []; ---

{description &&

{description}

}

{normalizedAuthors.length > 0 && ( {normalizedAuthors.map((a, i) => ( <> {a.url ? {a.name} : {a.name}} {shouldShowAffiliationSupers && Array.isArray(a.affiliationIndices) && a.affiliationIndices.length > 0 && ( {a.affiliationIndices.join(",")} )} {i < normalizedAuthors.length - 1 && } ))} )} {resolvedAffiliations.length > 0 && ( {resolvedAffiliations.map((af, i) => ( <> {af.url ? ( {af.name} ) : ( {af.name} )} {i < resolvedAffiliations.length - 1 && } ))} )} {published && ( {published} )}
{links && links.length > 0 && ( )}