"use client";
import { useState } from "react";
import { paperButtonVariants } from "@/components/ui/reader-pane";
import { useHydrated } from "@/components/ui/use-hydrated";
// The reader's Copy citation (a bench's reader pane): the house citation
// (`"quote" [title @ m:ss](url)`, lib/research/facets.mjs) on the clipboard.
// A copy the browser refuses shows the text to select instead -- a copy that
// silently does nothing is the worst failure for this button.
export default function CopyCitation({ text, label = "Copy citation" }: { text: string; label?: string }) {
const hydrated = useHydrated();
const [state, setState] = useState<"idle" | "done" | "failed">("idle");
return (
<>
{state === "failed" && (
e.currentTarget.select()} />
)}
>
);
}