import { ComponentChildren, JSX } from "preact"; import { useState } from "preact/hooks"; import { IS_BROWSER } from "$fresh/runtime.ts"; import { Button } from "../components/Button.tsx"; type Props = { copyText: string; children: ComponentChildren; disabled?: boolean; } & JSX.HTMLAttributes; export default function CopyButton(props: Props) { const { copyText, disabled = false, children, ...buttonProps } = props; const [clicked, setClicked] = useState(false); const startReset = () => { setTimeout(() => { setClicked(false); }, 2_000); }; return ( ); }