From d9d66e1301bdf29796cba016e7d4e63f5886b968 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Mon, 17 Feb 2025 23:36:23 +0100 Subject: [PATCH] update --- web/app/docs/installation/page.tsx | 1 + web/components/CopyableCode.tsx | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/web/app/docs/installation/page.tsx b/web/app/docs/installation/page.tsx index daf8fe2..dc15858 100644 --- a/web/app/docs/installation/page.tsx +++ b/web/app/docs/installation/page.tsx @@ -30,3 +30,4 @@ export default function InstallationPage() { ) } + diff --git a/web/components/CopyableCode.tsx b/web/components/CopyableCode.tsx index 9baee04..26c939f 100644 --- a/web/components/CopyableCode.tsx +++ b/web/components/CopyableCode.tsx @@ -3,17 +3,20 @@ import type React from "react" import { useState } from "react" import { Copy, Check } from "lucide-react" +import { cn } from "@/lib/utils" interface CopyableCodeProps { code: string + language?: string + className?: string } -const CopyableCode: React.FC = ({ code }) => { +const CopyableCode: React.FC = ({ code, language, className }) => { const [isCopied, setIsCopied] = useState(false) const copyToClipboard = async () => { try { - await navigator.clipboard.writeText(code) + await navigator.clipboard.writeText(decodeURIComponent(code)) setIsCopied(true) setTimeout(() => setIsCopied(false), 2000) } catch (err) { @@ -22,16 +25,16 @@ const CopyableCode: React.FC = ({ code }) => { } return ( -
-
-        {code}
+    
+
+        
       
) @@ -39,4 +42,3 @@ const CopyableCode: React.FC = ({ code }) => { export default CopyableCode -