diff --git a/docs/components/copyable-diff.tsx b/docs/components/copyable-diff.tsx new file mode 100644 index 000000000..86cee7d62 --- /dev/null +++ b/docs/components/copyable-diff.tsx @@ -0,0 +1,59 @@ +"use client"; + +import { Check, Clipboard } from "lucide-react"; +import { useState } from "react"; + +export function CopyableDiff({ code }: { code: string }) { + const [copied, setCopied] = useState(false); + const lines = code.replace(/^\n|\n$/g, "").split("\n"); + const finalCode = lines + .filter((line) => !line.startsWith("-")) + .map((line) => (/^[+=]/.test(line) ? line.slice(1) : line)) + .join("\n"); + + async function copy() { + await navigator.clipboard.writeText(finalCode); + setCopied(true); + window.setTimeout(() => setCopied(false), 1500); + } + + return ( +
+ +
+        
+          {lines.map((line, index) => {
+            const marker = line[0];
+            const changed = marker === "+" || marker === "-";
+            const content = changed || marker === "=" ? line.slice(1) : line;
+
+            return (
+              
+                
+                  {changed ? marker : " "}
+                
+                {content || " "}
+              
+            );
+          })}
+        
+      
+
+ ); +} diff --git a/docs/content/docs/openui-lang/quickstart.mdx b/docs/content/docs/openui-lang/quickstart.mdx index 7934e182b..e1b0ec369 100644 --- a/docs/content/docs/openui-lang/quickstart.mdx +++ b/docs/content/docs/openui-lang/quickstart.mdx @@ -1,99 +1,334 @@ --- title: Quick Start -description: Bootstrap a GenUI chat app in under a minute. +description: Build a Recipe Remix agent with OpenUI Cloud in about 10 minutes. --- -