'use client'; import { Check, Share2 } from 'lucide-react'; import { useState } from 'react'; import { t } from '@/i18n'; /** Web Share API when available, otherwise copies the URL to the clipboard. */ export function ShareButton({ title, className }: { title: string; className?: string }) { const [done, setDone] = useState(false); const share = async () => { const url = window.location.href; try { if (navigator.share) { await navigator.share({ title, url }); return; } await navigator.clipboard.writeText(url); setDone(true); setTimeout(() => setDone(false), 1800); } catch { /* cancelled */ } }; return ( ); }