Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions components/JsonToTable/JsonToTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,22 @@ function Tabs({ tables }) {
{tables.map((table) => (
<button
key={table.name}
className={
activeTab === table.name ? "tabButton activeTab" : "tabButton"
}
className={activeTab === table.name ? "tabButton activeTab" : "tabButton"}
onClick={() => setActiveTab(table.name)}
>
{table.name}
</button>
))}
</div>
<div className="tabContent">
{tables.map((table) =>
activeTab === table.name ? (
<TableDetail key={table.name} table={table} />
) : null
)}
{tables.map((table) => (activeTab === table.name ? <TableDetail key={table.name} table={table} /> : null))}
</div>
</div>
);
}

function TablesByTag({ data, tag }) {
const filteredTables = data.tables.filter((table) =>
table.tags.includes(tag)
);
function Table({ data, tag }) {
const filteredTables = data.tables.filter((table) => table.tags.includes(tag));

if (filteredTables.length === 0) {
return <div>No tables found with tag "{tag}".</div>;
Expand All @@ -73,4 +65,4 @@ function TablesByTag({ data, tag }) {
);
}

export default TablesByTag;
export default Table;
2 changes: 1 addition & 1 deletion scripts/src/cmd/regenerate-mdx-from-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function createFile(datasetName: string, hasRawTables: boolean, hasParsedTables:
title: ${pageTitle}
---

import Table from '@site/components/JsonToTable/JsonToTable';

import json from '@site/data/${datasetName}-table.json'


Expand Down
2 changes: 1 addition & 1 deletion scripts/src/cmd/tables-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function createFile(datasetName: string, hasRawTables: boolean, hasParsedTables:
title: ${pageTitle}
---

import Table from '@site/components/JsonToTable/JsonToTable';

import json from '@site/data/${datasetName}-table.json'


Expand Down