"use client"; import { useState } from "react"; // 투표(경기) 공유 — 모바일 네이티브 공유(invoke), 미지원 시 클립보드 복사 폴백 (D8) export default function ShareButton({ url, title, text, }: { url: string; title: string; text: string; }) { const [copied, setCopied] = useState(false); const onShare = async () => { if (typeof navigator !== "undefined" && navigator.share) { try { await navigator.share({ title, text, url }); return; } catch { /* 사용자 취소 */ } } try { await navigator.clipboard.writeText(`${text}\n${url}`); setCopied(true); setTimeout(() => setCopied(false), 1800); } catch { /* noop */ } }; return ( ); }