From 4bfc89302fb54fe0a393f7210aa5f487bcaf394c Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Wed, 19 Mar 2025 00:48:35 -0500 Subject: [PATCH] feat: test button --- .../src/pages/[...locale]/api/_index.tsx | 35 +++++--- .../src/pages/[...locale]/api/index.astro | 84 +++++++++++-------- .../src/pages/api/gallery/[avatar].webp.ts | 3 +- .../website/src/pages/api/tanks/[id].json.ts | 5 +- 4 files changed, 82 insertions(+), 45 deletions(-) diff --git a/packages/website/src/pages/[...locale]/api/_index.tsx b/packages/website/src/pages/[...locale]/api/_index.tsx index 9e13dc3ec..99099c18d 100644 --- a/packages/website/src/pages/[...locale]/api/_index.tsx +++ b/packages/website/src/pages/[...locale]/api/_index.tsx @@ -1,14 +1,16 @@ -import { Code, Link, Table } from '@radix-ui/themes'; +import { OpenInNewWindowIcon } from '@radix-ui/react-icons'; +import { Code, IconButton, Link, Table } from '@radix-ui/themes'; import { useState } from 'react'; import type { APIPath } from './index.astro'; interface SlugsTableProps { slugs: APIPath['slugs']; + path: string; } const MAX_UNEXPANDED = 5; -export function SlugsTable({ slugs }: SlugsTableProps) { +export function SlugsTable({ slugs, path }: SlugsTableProps) { if (slugs === undefined) return null; const [expanded, setExpanded] = useState(false); @@ -17,25 +19,29 @@ export function SlugsTable({ slugs }: SlugsTableProps) {
- #
-
-
- {title}
-
+ {title}
- {api.path}
-
-
- {api.comment}
-
+ {api.path}
+
+ {!api.slugs && (
+
- {tag}
-
+ {api.tags.map(({ tag, description, discriminator }) => {
+ let color: CodeProps['color'] | undefined = undefined;
- {discriminator && (
-
- {discriminator}
-
- )}
+ switch (tag) {
+ case '@warning':
+ color = 'amber';
+ break;
+ }
- {description && (
-
- {description}
+ return (
+
+
+ {tag}
- )}
-
- ))}
+
+ {discriminator && (
+
+ {discriminator}
+
+ )}
+
+ {description && {description} }
+