'use client' import { Phone, MessageSquare, MapPin } from 'lucide-react' interface StickyActionBarProps { phone?: string | null whatsapp?: string | null latitude?: number | null longitude?: number | null address?: string labels: { call: string whatsapp: string directions: string } } export default function StickyActionBar({ phone, whatsapp, latitude, longitude, address, labels, }: StickyActionBarProps) { if (!phone && !whatsapp && !latitude && !longitude) { return null } const getWhatsAppLink = (number: string) => { const cleanNum = number.replace(/\D/g, '') return `https://wa.me/${cleanNum}` } const getDirectionsLink = () => { if (latitude && longitude) { return `https://www.google.com/maps/dir/?api=1&destination=${latitude},${longitude}` } if (address) { return `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(address + ', Marmaris')}` } return 'https://maps.google.com' } return (
{/* WhatsApp Action */} {whatsapp ? ( {labels.whatsapp} ) : (
)} {/* Call Action */} {phone ? ( {labels.call} ) : (
)} {/* Directions Action */} {(latitude || longitude || address) && ( {labels.directions} )}
) }