docu v 1.11.0

This commit is contained in:
Wildan Nursahidan
2025-05-26 22:28:27 +07:00
parent bbf23b66eb
commit 3f6a407a30
57 changed files with 1742 additions and 3924 deletions

View File

@@ -0,0 +1,33 @@
"use client";
import { CheckIcon, CopyIcon } from "lucide-react";
import { Button } from "../ui/button";
import { useState } from "react";
export default function Copy({ content }: { content: string }) {
const [isCopied, setIsCopied] = useState(false);
async function handleCopy() {
await navigator.clipboard.writeText(content);
setIsCopied(true);
setTimeout(() => {
setIsCopied(false);
}, 2000);
}
return (
<Button
variant="secondary"
className="border"
size="xs"
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="w-3 h-3" />
) : (
<CopyIcon className="w-3 h-3" />
)}
</Button>
);
}