mirror of
https://github.com/discordjs/discord.js.git
synced 2026-05-30 23:50:07 +00:00
27 lines
561 B
TypeScript
27 lines
561 B
TypeScript
'use client';
|
|
|
|
import type { TokenDocumentation } from '@discordjs/api-extractor-utils';
|
|
import Link from 'next/link';
|
|
|
|
export function HyperlinkedText({ tokens }: { tokens: TokenDocumentation[] }) {
|
|
return (
|
|
<>
|
|
{tokens.map((token, idx) => {
|
|
if (token.path) {
|
|
return (
|
|
<Link
|
|
className="text-blurple focus:ring-width-2 focus:ring-blurple rounded outline-0 focus:ring"
|
|
href={token.path}
|
|
key={idx}
|
|
>
|
|
{token.text}
|
|
</Link>
|
|
);
|
|
}
|
|
|
|
return <span key={idx}>{token.text}</span>;
|
|
})}
|
|
</>
|
|
);
|
|
}
|