Files
autojobs/frontend/app/contact/page.tsx
T

126 lines
6.4 KiB
TypeScript

"use client"
import { useState } from "react"
import Link from "next/link"
export default function ContactPage() {
const [form, setForm] = useState({
name: "", company: "", email: "", phone: "", type: "enterprise", message: ""
})
const [loading, setLoading] = useState(false)
const [success, setSuccess] = useState(false)
const [error, setError] = useState("")
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
setLoading(true)
setError("")
try {
await new Promise(resolve => setTimeout(resolve, 1500))
setSuccess(true)
} catch {
setError("Something went wrong. Please try again.")
}
setLoading(false)
}
return (
<div className="min-h-screen bg-slate-900">
<nav className="flex justify-between items-center px-4 py-4 max-w-2xl mx-auto">
<Link href="/autojobs" className="text-xl font-bold text-white">
Auto<span className="text-blue-400">Jobs</span>
</Link>
<Link href="/autojobs" className="text-slate-400 hover:text-white transition text-xs">
Back
</Link>
</nav>
<main className="max-w-xl mx-auto px-4 py-8">
<div className="text-center mb-8">
<div className="inline-block px-3 py-1 rounded-full bg-purple-500/20 border border-purple-500/30 text-purple-300 text-xs mb-3">
Enterprise Solutions
</div>
<h1 className="text-2xl font-bold text-white mb-2">Contact Us</h1>
<p className="text-slate-400 text-sm">Ready for unlimited job applications? Let's build a custom plan for your agency.</p>
</div>
{success ? (
<div className="bg-green-500/20 border border-green-500/30 rounded-2xl p-8 text-center">
<div className="text-4xl mb-3"></div>
<h2 className="text-xl font-bold text-white mb-2">Message Sent!</h2>
<p className="text-slate-300 mb-4 text-sm">Our enterprise team will respond within 24 hours.</p>
<Link href="/autojobs" className="text-blue-400 hover:underline text-sm"> Back to AutoJobs</Link>
</div>
) : (
<form onSubmit={handleSubmit} className="bg-slate-800 rounded-2xl p-5 border border-slate-700">
{error && (
<div className="mb-4 p-3 bg-red-500/20 border border-red-500/30 rounded-xl text-red-400 text-xs">
{error}
</div>
)}
<div className="space-y-4">
<div className="grid grid-cols-2 gap-3">
<div>
<label className="block text-xs text-slate-400 mb-1">Full Name *</label>
<input required type="text" value={form.name} onChange={e => setForm({...form, name: e.target.value})}
className="w-full px-3 py-2.5 bg-slate-700 border border-slate-600 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-blue-500 text-sm"
placeholder="Sarah Johnson" />
</div>
<div>
<label className="block text-xs text-slate-400 mb-1">Company *</label>
<input required type="text" value={form.company} onChange={e => setForm({...form, company: e.target.value})}
className="w-full px-3 py-2.5 bg-slate-700 border border-slate-600 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-blue-500 text-sm"
placeholder="Acme Recruiting" />
</div>
</div>
<div className="grid grid-cols-2 gap-3">
<div>
<label className="block text-xs text-slate-400 mb-1">Email *</label>
<input required type="email" value={form.email} onChange={e => setForm({...form, email: e.target.value})}
className="w-full px-3 py-2.5 bg-slate-700 border border-slate-600 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-blue-500 text-sm"
placeholder="sarah@acme.com" />
</div>
<div>
<label className="block text-xs text-slate-400 mb-1">Phone</label>
<input type="tel" value={form.phone} onChange={e => setForm({...form, phone: e.target.value})}
className="w-full px-3 py-2.5 bg-slate-700 border border-slate-600 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-blue-500 text-sm"
placeholder="+1 555 123" />
</div>
</div>
<div>
<label className="block text-xs text-slate-400 mb-1">Interest</label>
<select value={form.type} onChange={e => setForm({...form, type: e.target.value})}
className="w-full px-3 py-2.5 bg-slate-700 border border-slate-600 rounded-xl text-white focus:outline-none focus:border-blue-500 text-sm">
<option value="enterprise">Enterprise Unlimited</option>
<option value="agency">Agency High Volume</option>
<option value="partnership">Partnership / Reseller</option>
<option value="custom">Custom Integration</option>
</select>
</div>
<div>
<label className="block text-xs text-slate-400 mb-1">Message *</label>
<textarea required rows={3} value={form.message} onChange={e => setForm({...form, message: e.target.value})}
className="w-full px-3 py-2.5 bg-slate-700 border border-slate-600 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-blue-500 resize-none text-sm"
placeholder="Tell us about your needs..." />
</div>
<button type="submit" disabled={loading}
className="w-full py-3 bg-purple-500 hover:bg-purple-600 disabled:bg-slate-600 text-white rounded-xl font-semibold transition text-sm">
{loading ? "Sending..." : "Send Message"}
</button>
</div>
</form>
)}
<div className="mt-6 text-center text-slate-500 text-xs">
<p>Prefer email? <a href="mailto:enterprise@hostpioneers.com" className="text-blue-400 hover:underline">enterprise@hostpioneers.com</a></p>
<p className="mt-1">Response time: &lt;24 hours</p>
</div>
</main>
</div>
)
}