import { motion, AnimatePresence } from "motion/react"; import { Phone, MessageSquare } from "lucide-react"; import { BUSINESS_INFO, TireProduct } from "../data"; interface FloatingActionsProps { darkMode: boolean; selectedTire?: TireProduct | null; } export default function FloatingActions({ darkMode, selectedTire }: FloatingActionsProps) { // Format dynamic WhatsApp URL const getWhatsAppUrl = () => { if (!selectedTire) { return `${BUSINESS_INFO.whatsappUrl}?text=${encodeURIComponent( "Hello Haider Brothers, I need assistance with tyres right now" )}`; } const message = `Hello Haider Brothers, I'm interested in the following tyre: 🚗 *Tyre details:* • *Brand:* ${selectedTire.brand} • *Model:* ${selectedTire.name} • *Size:* ${selectedTire.size} • *Features:* ${selectedTire.feature} • *Price:* PKR ${selectedTire.price.toLocaleString()} • *Stock status:* ${selectedTire.stock !== undefined ? `${selectedTire.stock} Units Available` : "Available"} Could you please confirm the current stock and availability for installation? Thank you!`; return `${BUSINESS_INFO.whatsappUrl}?text=${encodeURIComponent(message)}`; }; const hasSelectedTire = !!selectedTire; return (
{selectedTire.brand} {selectedTire.name}
Click below to send instant specifications over WhatsApp!