import React, { useState } from 'react'; import { Input } from './ui/input'; import { Textarea } from './ui/textarea'; import { Label } from './ui/label'; import { Select } from './ui/select'; import { Button } from './ui/button'; export function ContactForm() { const [formState, setFormState] = useState({ name: '', email: '', company: '', service: '', message: '', }); const [formStatus, setFormStatus] = useState<'idle' | 'submitting' | 'success' | 'error'>('idle'); const handleChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormState(prev => ({ ...prev, [name]: value })); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); setFormStatus('submitting'); // Simulate form submission with a timeout setTimeout(() => { // In a real app, you would send the data to a server here console.log('Form submitted:', formState); setFormStatus('success'); // Reset form after successful submission setFormState({ name: '', email: '', company: '', service: '', message: '', }); // Reset status after showing success message for a while setTimeout(() => { setFormStatus('idle'); }, 3000); }, 1500); }; return (
{/* Name and Email - Stack on mobile, side-by-side on tablet+ */}
{/* Company and Service Interest - Stack on mobile, side-by-side on tablet+ */}