diff --git a/apps/website/app/contact/page.tsx b/apps/website/app/contact/page.tsx index b56e51b..df8ad26 100644 --- a/apps/website/app/contact/page.tsx +++ b/apps/website/app/contact/page.tsx @@ -17,6 +17,7 @@ import { cn } from '@/lib/utils' interface ContactFormData { inquiryType: '' | 'support' | 'sales' | 'other' + deploymentType: '' | 'cloud' | 'self-hosted' firstName: string lastName: string email: string @@ -29,6 +30,7 @@ export default function ContactPage() { const [isSubmitted, setIsSubmitted] = useState(false) const [formData, setFormData] = useState({ inquiryType: '', + deploymentType: '', firstName: '', lastName: '', email: '', @@ -43,6 +45,9 @@ export default function ContactPage() { if (!formData.inquiryType) { newErrors.inquiryType = 'Please select what we can help you with' } + if (formData.inquiryType === 'support' && !formData.deploymentType) { + newErrors.deploymentType = 'Please select your deployment type' + } if (!formData.firstName.trim()) { newErrors.firstName = 'First name is required' } @@ -72,6 +77,11 @@ export default function ContactPage() { return } + // Prevent submission for self-hosted support requests + if (formData.inquiryType === 'support' && formData.deploymentType === 'self-hosted') { + return + } + setIsSubmitting(true) try { @@ -92,6 +102,7 @@ export default function ContactPage() { setFormData({ inquiryType: '', + deploymentType: '', firstName: '', lastName: '', email: '', @@ -112,7 +123,14 @@ export default function ContactPage() { } const handleInputChange = (field: keyof ContactFormData, value: any) => { - setFormData((prev) => ({ ...prev, [field]: value })) + setFormData((prev) => { + const updated = { ...prev, [field]: value } + // Reset deploymentType when inquiryType changes and is not support + if (field === 'inquiryType' && value !== 'support') { + updated.deploymentType = '' + } + return updated + }) if (errors[field]) { setErrors((prev) => { const newErrors = { ...prev } @@ -210,6 +228,85 @@ export default function ContactPage() { )} + {formData.inquiryType === 'support' && ( +
+ + + {errors.deploymentType && ( +

+ {errors.deploymentType} +

+ )} + + {formData.deploymentType === 'self-hosted' && ( +
+

+ Self-Hosted Support +

+

+ We currently don't provide direct support for self-hosted deployments through this form. However, our community is here to help! +

+
+

+ Please use one of these channels to get assistance: +

+ +
+
+ )} +
+ )} +