feat(website): add extends clauses, enum members and automatic -types links (#8270)

* feat(website): add extends clauses, enum members and automatic -types links

* chore: remove vscode settings

* refactor: remove util file
This commit is contained in:
Suneet Tipirneni
2022-07-12 16:42:32 -04:00
committed by GitHub
parent 787654816d
commit 1ed605eaa4
21 changed files with 234 additions and 119 deletions

View File

@@ -0,0 +1,30 @@
import type { TokenDocumentation } from '~/util/parse.server';
export interface HyperlinkedTextProps {
tokens: TokenDocumentation[];
}
/**
* Constructs a hyperlinked html node based on token type references
*
* @param tokens An array of documentation tokens to construct the HTML
*
* @returns An array of JSX elements and string comprising the hyperlinked text
*/
export function HyperlinkedText({ tokens }: HyperlinkedTextProps) {
return (
<>
{tokens.map((token) => {
if (token.path) {
return (
<a key={token.text} href={token.path}>
{token.text}
</a>
);
}
return token.text;
})}
</>
);
}