mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
28 lines
594 B
TypeScript
28 lines
594 B
TypeScript
import type { TokenDocumentation } from '@discordjs/api-extractor-utils';
|
|
import { Anchor, Text } from '@mantine/core';
|
|
import Link from 'next/link';
|
|
|
|
export function HyperlinkedText({ tokens }: { tokens: TokenDocumentation[] }) {
|
|
return (
|
|
<>
|
|
{tokens.map((token, idx) => {
|
|
if (token.path) {
|
|
return (
|
|
<Link key={idx} href={token.path} passHref prefetch={false}>
|
|
<Anchor component="a" inherit>
|
|
{token.text}
|
|
</Anchor>
|
|
</Link>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<Text key={idx} span unstyled>
|
|
{token.text}
|
|
</Text>
|
|
);
|
|
})}
|
|
</>
|
|
);
|
|
}
|