chore: move website and guide out of packages

This commit is contained in:
iCrawl
2022-10-10 01:22:48 +02:00
parent 0a9d57b011
commit 3ed668e539
175 changed files with 428 additions and 487 deletions

View File

@@ -0,0 +1,29 @@
import type { ParameterDocumentation } from '@discordjs/api-extractor-utils';
import { useMemo } from 'react';
import { HyperlinkedText } from './HyperlinkedText';
import { Table } from './Table';
import { TSDoc } from './tsdoc/TSDoc';
const columnStyles = {
Name: 'font-mono whitespace-nowrap',
Type: 'font-mono whitespace-pre-wrap break-normal',
};
export function ParameterTable({ data }: { data: ParameterDocumentation[] }) {
const rows = useMemo(
() =>
data.map((param) => ({
Name: param.name,
Type: <HyperlinkedText tokens={param.tokens} />,
Optional: param.isOptional ? 'Yes' : 'No',
Description: param.paramCommentBlock ? <TSDoc node={param.paramCommentBlock} /> : 'None',
})),
[data],
);
return (
<div className="overflow-x-auto">
<Table columnStyles={columnStyles} columns={['Name', 'Type', 'Optional', 'Description']} rows={rows} />
</div>
);
}