diff --git a/docs/src/app/page.tsx b/docs/src/app/page.tsx index 7e5ab13..f9d3dd3 100644 --- a/docs/src/app/page.tsx +++ b/docs/src/app/page.tsx @@ -54,28 +54,15 @@ agent-browser close`} />
  1. Rust CLI - Parses commands, communicates with daemon
  2. Node.js Daemon - Manages Playwright browser instance
  3. -
  4. Fallback - Uses Node.js directly if native binary unavailable

Daemon starts automatically and persists between commands.

Platforms

- - - - - - - - - - - - - - -
PlatformBinary
macOS ARM64Native Rust
macOS x64Native Rust
Linux ARM64Native Rust
Linux x64Native Rust
Windows x64Native Rust
+

+ Native Rust binaries for macOS (ARM64, x64), Linux (ARM64, x64), and Windows (x64). +

); diff --git a/docs/src/components/code-block.tsx b/docs/src/components/code-block.tsx index ba101b3..7c1ef4f 100644 --- a/docs/src/components/code-block.tsx +++ b/docs/src/components/code-block.tsx @@ -1,4 +1,5 @@ import { codeToHtml } from "shiki"; +import { CopyButton } from "./copy-button"; interface CodeBlockProps { code: string; @@ -6,15 +7,16 @@ interface CodeBlockProps { } export async function CodeBlock({ code, lang = "bash" }: CodeBlockProps) { - const html = await codeToHtml(code.trim(), { + const trimmedCode = code.trim(); + const html = await codeToHtml(trimmedCode, { lang, theme: "github-dark-default", }); return ( -
+
+ +
+
); } diff --git a/docs/src/components/copy-button.tsx b/docs/src/components/copy-button.tsx new file mode 100644 index 0000000..37e5bbe --- /dev/null +++ b/docs/src/components/copy-button.tsx @@ -0,0 +1,35 @@ +"use client"; + +import { useState } from "react"; + +interface CopyButtonProps { + code: string; +} + +export function CopyButton({ code }: CopyButtonProps) { + const [copied, setCopied] = useState(false); + + const handleCopy = async () => { + await navigator.clipboard.writeText(code); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }; + + return ( + + ); +}