'use client'; import { Button } from "@/components/ui/button"; import { Copy } from "lucide-react"; import { useState } from "react"; export const CodeBlock = ({ code, lang }: { code: string, lang: string }) => { const [clicked, setClicked] = useState(false); const [animate, setAnimate] = useState(false); const copy = () => { navigator.clipboard.writeText(code); setClicked(!clicked); setAnimate(true); setTimeout(() => { setAnimate(false); }, 500); }; return (

{lang}

            
                {code}
            
        
); }