diff --git a/app/components/CommandSnippet.tsx b/app/components/CommandSnippet.tsx new file mode 100644 index 0000000..6d2633f --- /dev/null +++ b/app/components/CommandSnippet.tsx @@ -0,0 +1,40 @@ +"use client"; + +import { useState } from "react"; + +type CommandSnippetProps = { + command: string; + label?: string; +}; + +export default function CommandSnippet({ command, label = "Command" }: CommandSnippetProps) { + const [copied, setCopied] = useState(false); + + const copyCommand = async () => { + await navigator.clipboard.writeText(command); + setCopied(true); + window.setTimeout(() => setCopied(false), 1500); + }; + + return ( +
+
+ + {label} + + +
+
+
+          {command}
+        
+
+
+ ); +} diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index 8d04c4c..048c031 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -1,4 +1,6 @@ +import Image from "next/image"; import Link from "next/link"; +import { withBasePath } from "../services/sitePath"; export default function Navbar() { return (