import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import { motion, useInView } from "framer-motion"; import { CheckCircle, Mail, MapPin, Phone, Send } from "lucide-react"; import { useRef, useState } from "react"; const contactInfo = [ { icon: Mail, label: "Email", value: "techzaa.alpha@gmail.com" }, { icon: Phone, label: "Phone", value: "+880 19623-21487" }, { icon: MapPin, label: "Location", value: "Rangpur, Bangladesh" }, ]; export default function ContactSection() { const ref = useRef(null); const isInView = useInView(ref, { once: true, margin: "-100px" }); const [formData, setFormData] = useState({ name: "", email: "", subject: "", message: "", }); const [isSubmitting, setIsSubmitting] = useState(false); const [isSuccess, setIsSuccess] = useState(false); const [mousePositions, setMousePositions] = useState< Record >({}); const handleMouseMove = ( index: number, e: React.MouseEvent, ) => { const rect = e.currentTarget.getBoundingClientRect(); const x = ((e.clientX - rect.left) / rect.width) * 100; const y = ((e.clientY - rect.top) / rect.height) * 100; setMousePositions((prev) => ({ ...prev, [index]: { x, y } })); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsSubmitting(true); await new Promise((resolve) => setTimeout(resolve, 1500)); setIsSubmitting(false); setIsSuccess(true); setTimeout(() => { setIsSuccess(false); setFormData({ name: "", email: "", subject: "", message: "" }); }, 3000); }; const handleChange = ( e: React.ChangeEvent, ) => { setFormData((prev) => ({ ...prev, [e.target.name]: e.target.value, })); }; return (
{/* Section Header */} LET'S CONNECT

Get In Touch

Ready to bring your vision to life? Drop us a message.

{/* Interactive Contact Info */}

Contact Information

Our team typically responds within 24 hours.

{contactInfo.map((item, index) => { const pos = mousePositions[index] || { x: 50, y: 50 }; return ( handleMouseMove(index, e)} onMouseLeave={() => { setMousePositions((prev) => ({ ...prev, [index]: { x: 50, y: 50 }, })); }} whileHover={{ scale: 1.02 }} className="group relative rounded-xl overflow-hidden cursor-pointer h-full" >

{item.label}

{item.value}

); })}
{/* Interactive Contact Form */}
{/* Subtle moving gradient */}
{isSuccess ? (

Message Sent Successfully!

Thank you! We'll get back to you very soon.

) : (