Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Extract HTML to component

Tereza Tizkova629752fb6910
diff --git a/apps/docs/src/app/sandbox/templates/premade/TemplateName.tsx b/apps/docs/src/app/sandbox/templates/premade/TemplateName.tsx
new file mode 100644
index 000000000..1da0dcb58
--- /dev/null
+++ b/apps/docs/src/app/sandbox/templates/premade/TemplateName.tsx
@@ -0,0 +1,14 @@
+export interface Props {
+ templateName: string
+}
+
+export function TemplateName({
+ templateName,
+}: Props) {
+ return (
+ <div className="pr-1 w-[320px] flex items-center justify-start space-x-2 border border-gray-600 rounded">
+ <span className="font-mono text-sm px-2 h-8 flex items-center justify-center border-r border-gray-600">template name</span>
+ <span className="font-mono text-sm text-gray-200">{templateName}</span>
+ </div>
+ )
+}
\ No newline at end of file
diff --git a/apps/docs/src/app/sandbox/templates/premade/page.mdx b/apps/docs/src/app/sandbox/templates/premade/page.mdx
index 6fae1c3f6..f5f6cb5c5 100644
--- a/apps/docs/src/app/sandbox/templates/premade/page.mdx
+++ b/apps/docs/src/app/sandbox/templates/premade/page.mdx
@@ -3,6 +3,8 @@ import {
FileCode,
} from 'lucide-react'
+import { TemplateName } from './TemplateName'
+
# Premade Sandboxes
To get your started quickly, we offer two premade sandboxes.
@@ -20,10 +22,8 @@ To get your started quickly, we offer two premade sandboxes.
/>
Template File
</Link>
-<div className="pr-1 w-[320px] flex items-center justify-start space-x-2 border border-gray-600 rounded">
- <span className="font-mono text-sm px-2 h-8 flex items-center justify-center border-r border-gray-600">template name</span>
- <span className="font-mono text-sm text-gray-200">base</span>
-</div>
+
+<TemplateName templateName="base"/>
### Features
Ubuntu-based sandbox with Nodejs, Python 3, and essentials libraries like `curl`.
@@ -48,10 +48,7 @@ The base sandbox has all the features of the [Sandbox API](/sandbox/api/envs) av
Template File
</Link>
-<div className="pr-1 w-[320px] flex items-center justify-start space-x-2 border border-gray-600 rounded">
- <span className="font-mono text-sm px-2 h-8 flex items-center justify-center border-r border-gray-600">template name</span>
- <span className="font-mono text-sm text-gray-200">code-interpreter</span>
-</div>
+<TemplateName templateName="code-interpreter"/>
### Features
Ubuntu-based sandbox with Python 3 and data science Python libraries like `pandas`, `numpy`, or `matplotlib`.