--- interface Props { keywords: (string | [string, number])[]; } const { keywords } = Astro.props; ---
{ keywords.map((x, i) => { let keyword = typeof x === "string" ? x : x[0]; let n = typeof x === "string" ? undefined : x[1]; return ( <>{i > 0 && " "}{ n !== undefined && {n} }{" "}#{ keyword }> ); }) }