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

@@ -1,3 +1,5 @@
import type { ReactNode } from 'react';
export interface RowData {
monospace?: boolean;
content: string;
@@ -6,7 +8,7 @@ export interface RowData {
export interface TableProps {
columns: string[];
columnStyles?: Record<string, string>;
rows: Record<string, string | (string | JSX.Element)[]>[];
rows: Record<string, ReactNode>[];
className?: string | undefined;
}
@@ -26,20 +28,16 @@ export function Table({ rows, columns, columnStyles, className }: TableProps) {
<tbody>
{rows.map((row, i) => (
<tr key={i}>
{Object.entries(row).map(([colName, val]) => {
console.log(colName);
console.log(columnStyles?.[colName]);
return (
<td
key={colName}
className={`p-2 text-sm border-b text-left border-slate-300 break-all ${
columnStyles?.[colName] ?? ''
}`}
>
{val}
</td>
);
})}
{Object.entries(row).map(([colName, val]) => (
<td
key={colName}
className={`p-2 text-sm border-b text-left border-slate-300 break-all ${
columnStyles?.[colName] ?? ''
}`}
>
{val}
</td>
))}
</tr>
))}
</tbody>