"use client" import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEnvelope, faTimes, faPaperPlane, faSpinner } from '@fortawesome/free-solid-svg-icons'; export default function ContactBubble() { const { t } = useTranslation(); const [isOpen, setIsOpen] = useState(false); const [isSending, setIsSending] = useState(false); const [sent, setSent] = useState(false); const [form, setForm] = useState({ name: '', email: '', subject: '', message: '' }); const handleChange = (e: React.ChangeEvent) => { setForm((prev) => ({ ...prev, [e.target.name]: e.target.value })); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsSending(true); // Simulate sending await new Promise((r) => setTimeout(r, 1200)); setIsSending(false); setSent(true); setTimeout(() => { setSent(false); setIsOpen(false); setForm({ name: '', email: '', subject: '', message: '' }); }, 2500); }; return ( <> {/* Floating bubble */} {/* Backdrop */} {isOpen && (
setIsOpen(false)} /> )} {/* Modal */}
{/* Modal header */}

{t('contact_us', 'Контактирај нè')}

{/* Modal body */}
{sent ? (

{t('contact_sent_title', 'Пораката е испратена!')}

{t('contact_sent_desc', 'Ќе ви одговориме наскоро.')}

) : (
{/* Name */}
{/* Email */}
{/* Subject */}
{/* Message */}