diff --git a/playground/shared/src/ShareButton.tsx b/playground/shared/src/ShareButton.tsx index 65fdca5da7..05a461bd48 100644 --- a/playground/shared/src/ShareButton.tsx +++ b/playground/shared/src/ShareButton.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import AstralButton from "./AstralButton"; -export default function ShareButton({ onShare }: { onShare: () => void }) { +export default function ShareButton({ onShare }: { onShare: () => Promise }) { const [copied, setCopied] = useState(false); useEffect(() => { @@ -29,9 +29,9 @@ export default function ShareButton({ onShare }: { onShare: () => void }) { type="button" className="relative flex-none leading-6 py-1.5 px-3 shadow-xs disabled:opacity-50" disabled={copied} - onClick={() => { + onClick={async () => { + await onShare(); setCopied(true); - onShare(); }} >