- {!active.hideLineNumbers && (
-
{i + 1}
- )}
-
+ {!active.hideLineNumbers && (
+
+ {tokens.map((_, i) => (
+
+ {i + 1}
+
+ ))}
+
+ )}
+
+ {tokens.map((line, i) => (
+
{line.map((token, key) => (
))}
-
- ))}
+ ))}
+
)}
diff --git a/www/apps/ui/src/props/code-block.tsx b/www/apps/ui/src/props/code-block.tsx
index 090216e5f8..abbc7681c5 100644
--- a/www/apps/ui/src/props/code-block.tsx
+++ b/www/apps/ui/src/props/code-block.tsx
@@ -8,7 +8,7 @@ const codeBlockProps: PropDataMap = [
type: "object",
name: "CodeSnippet[]",
shape:
- "{\n label: string\n language: string\n code: string\n hideLineNumbers?: boolean\n}[]",
+ "{\n label: string\n language: string\n code: string\n hideLineNumbers?: boolean\n hideCopy?: boolean\n}[]",
},
},
]