import type { ColumnSchema } from "@internal/tsql"; import { useState } from "react"; import { Badge } from "~/components/primitives/Badge"; import { CopyableText } from "~/components/primitives/CopyableText"; import { Paragraph } from "~/components/primitives/Paragraph"; import SegmentedControl from "~/components/primitives/SegmentedControl"; import { querySchemas } from "~/v3/querySchemas"; function ColumnHelpItem({ col }: { col: ColumnSchema }) { return (
{col.type}
{col.description && ( {col.description} )} {col.example && (
Example:
)} {col.allowedValues && col.allowedValues.length > 0 && (
Available options: {col.allowedValues.map((value) => ( ))}
)}
); } const tableOptions = querySchemas.map((s) => ({ label: s.name, value: s.name })); export function TableSchemaContent() { const [selectedTable, setSelectedTable] = useState(querySchemas[0].name); const table = querySchemas.find((s) => s.name === selectedTable) ?? querySchemas[0]; return (
{table.description && ( {table.description} )}
{Object.values(table.columns).map((col) => ( ))}
); }