diff --git a/islands/CopyButton.tsx b/islands/CopyButton.tsx index 6037c40..8acca88 100644 --- a/islands/CopyButton.tsx +++ b/islands/CopyButton.tsx @@ -2,9 +2,13 @@ import Preact from "preact"; import { useState } from "preact/hooks"; import { IS_BROWSER } from "$fresh/runtime.ts"; -export default function CopyButton( - props: { textBefore: string; textAfter: string } & Preact.PropsWithChildren, -) { +type Props = { + text: string; + children: Preact.ComponentChildren; + disabled?: boolean; +}; + +export default function CopyButton({ text, disabled = false, children }: Props) { const [clicked, setClicked] = useState(false); const startReset = () => { @@ -16,14 +20,14 @@ export default function CopyButton( return ( ); }