export const ClickableTableOfContents = ({ title, code }) => { const lines = String(code ?? "").replace(/\r\n/g, "\n").split("\n"); return (
{lines.map((line, index) => {
if (line.trim().startsWith("// NEXT_LINE_PLATFORM")) {
return null;
}
const match = line.match(/^(.*?)(?:\s*\/\/\s*\$stack-link-to:(#[a-zA-Z0-9_-]+))\s*$/);
const href = match?.[2] ?? null;
const text = match?.[1] ?? line;
if (text.trim() === "") {
return ;
}
const content = (
{text.replace(/\s+$/, "")}
);
if (!href) {
return (
{content}
);
}
return (
{content}
);
})}
{fullLabel}
{deprecated ? (
{title}
) : null}{title}
) : null}{title}
) : null}
{type}
{children ? (