import React, { useState } from 'react' import api from '../api' import Toast from '../components/Toast' import '../styles/global.css' export default function Contact() { const [formData, setFormData] = useState({ name: '', email: '', subject: '', message: '', }) const [loading, setLoading] = useState(false) const [submitted, setSubmitted] = useState(false) const [toast, setToast] = useState(null) const handleChange = (e) => { setFormData({ ...formData, [e.target.name]: e.target.value, }) } const handleSubmit = async (e) => { e.preventDefault() setLoading(true) try { await api.post('/contact', formData) setSubmitted(true) setFormData({ name: '', email: '', subject: '', message: '', }) setToast({ type: 'success', message: 'Message sent successfully! We\'ll get back to you soon.' }) setTimeout(() => { setSubmitted(false) }, 3000) } catch (error) { console.error('Error sending message:', error) setToast({ type: 'error', message: 'Error sending message. Please try again.' }) } finally { setLoading(false) } } return (

Contact Us

Get in Touch

📞 Phone

+972 53-244-1361

✉️ Email

info@brandmaster.com

Follow Us

Instagram WhatsApp

Send us a Message

{submitted && (
✓ Message sent successfully! We'll get back to you soon.
)}
{toast && ( setToast(null)} /> )}
) }