'use client' import { Button } from '@/components/ui/button' import { useState } from 'react' interface SimpleShareButtonsProps { title: string url: string } export function SimpleShareButtons({ title, url }: SimpleShareButtonsProps) { const [copied, setCopied] = useState(false) // Get full URL const fullUrl = typeof window !== 'undefined' ? window.location.origin + url : url const handleShare = (platform: string) => { let shareUrl = '' switch (platform) { case 'twitter': shareUrl = `https://twitter.com/intent/tweet?text=${encodeURIComponent(title)}&url=${encodeURIComponent(fullUrl)}` break case 'facebook': shareUrl = `https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(fullUrl)}` break case 'linkedin': shareUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(fullUrl)}&title=${encodeURIComponent(title)}` break case 'whatsapp': shareUrl = `https://wa.me/?text=${encodeURIComponent(title)} ${encodeURIComponent(fullUrl)}` break } if (shareUrl) { window.open(shareUrl, '_blank', 'width=600,height=400') } } const handleCopyLink = async () => { try { await navigator.clipboard.writeText(fullUrl) setCopied(true) setTimeout(() => setCopied(false), 2000) } catch (error) { console.error('Failed to copy:', error) } } return (