Files
Hayden Bleasel 44ae73eaaf Documentation (#219)
* Initial migration

* Update homepage

* Delete .source

* Fix gitignores

* Draft content

* Finish drafting content, migrate FAQ

* Update code-blocks.tsx

* Update route.ts

* Update next config

* Upgrade to Next.js 16, fix commands

* Update layout.tsx
2025-11-15 19:41:00 -08:00

28 lines
672 B
TypeScript

"use client";
import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
import { CheckIcon, CopyIcon } from "lucide-react";
type CopyPageProps = {
text: string;
};
export const CopyPage = ({ text }: CopyPageProps) => {
const [checked, handleCopy] = useCopyButton(async () => {
await navigator.clipboard.writeText(text);
});
const Icon = checked ? CheckIcon : CopyIcon;
return (
<button
className="flex items-center gap-1.5 text-muted-foreground text-sm transition-colors hover:text-foreground"
onClick={handleCopy}
type="button"
>
<Icon className="size-3.5" />
<span>Copy page</span>
</button>
);
};