diff --git a/src/www/src/app/(pages)/docs/_components/code-line-with-flag.tsx b/src/www/src/app/(pages)/docs/_components/code-line-with-flag.tsx deleted file mode 100644 index f53877e..0000000 --- a/src/www/src/app/(pages)/docs/_components/code-line-with-flag.tsx +++ /dev/null @@ -1,81 +0,0 @@ -"use client"; -import { useToast } from "@/components/ui/use-toast"; -import { useLang } from "@/providers/lang-provider"; -import { Check, Files, X } from "lucide-react"; -import { useState } from "react"; -import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; -import { vscDarkPlus } from "react-syntax-highlighter/dist/esm/styles/prism"; -interface ICodeLineWithFlag { - code: string; - language: string; - className?: string; - showLangFlag?: boolean; -} - -const CodeLineWithFlag = ({ - code, - language, - className, - showLangFlag = true, -}: ICodeLineWithFlag) => { - const { lang } = useLang(); - const [isCopying, setIsCopying] = useState({ - isCopying: false, - Icon: Files, - }); - - const { toast } = useToast(); - - const codeWithLangFlag = `${code} -${lang}`; - - const handleCopy = () => { - setIsCopying((prev) => ({ ...prev, isCopying: true })); - try { - navigator.clipboard.writeText(showLangFlag ? codeWithLangFlag : code); - setIsCopying((prev) => ({ ...prev, Icon: Check })); - toast({ - description: "Code copied to clipboard 🚀", - }); - } catch (err) { - setIsCopying((prev) => ({ ...prev, Icon: X })); - toast({ - description: "Failed to copy code 😢", - variant: "destructive", - }); - } finally { - setTimeout(() => { - setIsCopying(() => ({ isCopying: false, Icon: Files })); - }, 2000); - } - }; - - return ( -
- - - - {showLangFlag ? codeWithLangFlag : code} - -
- ); -}; -export default CodeLineWithFlag; diff --git a/src/www/src/app/(pages)/docs/_pages/change-log.tsx b/src/www/src/app/(pages)/docs/_pages/change-log.tsx index d45530e..2d6058b 100644 --- a/src/www/src/app/(pages)/docs/_pages/change-log.tsx +++ b/src/www/src/app/(pages)/docs/_pages/change-log.tsx @@ -41,16 +41,17 @@ const ChangeLog = async () => {

- - - {i + 1}. {pr.title.substring(0, 50)} - {pr.title.length > 50 ? "..." : ""} - + + {i + 1}. {pr.title}

-
+
{(() => { return (
{ if (!registry) return ; @@ -61,7 +61,7 @@ const MethodPage = async ({ slug }: { slug: string[] }) => { { title: "Installation", toRender: ( -