"use client";
import{Check,Share2}from"lucide-react";import{useState}from"react";
export function ShareButton(){const[done,setDone]=useState(false);async function share(){const data={title:document.title,url:location.href};if(navigator.share)await navigator.share(data);else await navigator.clipboard.writeText(location.href);setDone(true);setTimeout(()=>setDone(false),1800)}return <button onClick={share}>{done?<Check size={16}/>:<Share2 size={16}/>} {done?"Link copied":"Share event"}</button>}
