From 98e8df77c115991fadb830204ac8fd491a55bc47 Mon Sep 17 00:00:00 2001
From: Taesu <166604494+bytaesu@users.noreply.github.com>
Date: Sat, 21 Mar 2026 01:32:08 +0900
Subject: [PATCH] docs: improve DatabaseTable UI with tab indicators,
responsive scroll, and consistent typography (#8710)
---
landing/components/docs/mdx-components.tsx | 110 ++++++++++-----------
1 file changed, 55 insertions(+), 55 deletions(-)
diff --git a/landing/components/docs/mdx-components.tsx b/landing/components/docs/mdx-components.tsx
index 069dce7344..381917c667 100644
--- a/landing/components/docs/mdx-components.tsx
+++ b/landing/components/docs/mdx-components.tsx
@@ -3,7 +3,7 @@
import { ExternalLink, Key, Link as LinkIcon } from "lucide-react";
import Link from "next/link";
import type { ReactNode } from "react";
-import { useState } from "react";
+import { startTransition, useState } from "react";
import { Button } from "@/components/ui/button";
import { DynamicCodeBlock } from "@/components/ui/dynamic-code-block";
import type {
@@ -128,7 +128,7 @@ function TypeIcon({ type }: { type: string }) {
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
- className={cn(className, "text-emerald-600 dark:text-emerald-500/70")}
+ className={cn(className, "text-emerald-600")}
>
@@ -147,7 +147,7 @@ function TypeIcon({ type }: { type: string }) {
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
- className={cn(className, "text-violet-600 dark:text-violet-400/70")}
+ className={cn(className, "text-violet-600 dark:text-violet-500")}
>
@@ -165,7 +165,7 @@ function TypeIcon({ type }: { type: string }) {
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
- className={cn(className, "text-sky-600 dark:text-sky-400/70")}
+ className={cn(className, "text-sky-600")}
>
@@ -185,7 +185,7 @@ function TypeIcon({ type }: { type: string }) {
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
- className={cn(className, "text-orange-600 dark:text-orange-400/70")}
+ className={cn(className, "text-orange-500 dark:text-orange-600")}
>
@@ -281,7 +281,7 @@ function generateSchema(
function SchemaCodeBlock({ code, lang }: { code: string; lang: string }) {
return (
-
+
);
@@ -313,9 +313,9 @@ export function DatabaseTable({
const tableName = name || "table";
return (
-
+
{/* Header */}
-
+
-
+
{(
[
{ key: "table", label: "Table" },
@@ -361,15 +356,18 @@ export function DatabaseTable({
))}
@@ -377,107 +375,109 @@ export function DatabaseTable({
{/* Sub-selector for SQL dialect or Drizzle provider */}
{view === "sql" && (
-
+
{sqlDialects.map((d) => (
))}
)}
{view === "drizzle" && (
-
+
{drizzleProviders.map((d) => (
))}
)}
{view === "table" ? (
- <>
+
{/* Column headers */}
-
-
- Field
-
-
- Type
-
-
- Key
-
-
- Description
-
+
+ {["Field", "Type", "Key", "Description"].map((label) => (
+
+ {label}
+
+ ))}
{/* Rows */}
{fields.map((field) => (
-
+
{field.name}
-
+
{field.type}
{field.isPrimaryKey && (
-
+
- pk
+ PK
)}
{field.isForeignKey && (
-
+
- fk
+ FK
)}
{field.isOptional && (
-
+
?
)}
{!field.isPrimaryKey &&
!field.isForeignKey &&
!field.isOptional && (
- —
+ -
)}
-
))}
- >
+
) : (