File size: 716 Bytes
4bbfe8b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | export function SectionHeading(props: {
href: string
title: string
description?: string
as?: "h2" | "p"
slot?: string
}) {
const content = (
<>
<strong>
<a data-slot="heading-link" href={props.href}>
<span data-slot="heading-anchor" aria-hidden="true">
#
</span>
{props.title}
{props.description ? "." : ""}
</a>
</strong>
{props.description && (
<>
{" "}
<span>{props.description}</span>
</>
)}
</>
)
if (props.as === "h2") return <h2 data-slot={props.slot ?? "section-title"}>{content}</h2>
return <p data-slot={props.slot ?? "section-title"}>{content}</p>
}
|