From 335601b00e999b314f105e3fc27b202fee039cef Mon Sep 17 00:00:00 2001 From: null Date: Tue, 26 May 2026 12:55:23 -0500 Subject: [PATCH] remove submit ticket --- src/pages/Support.jsx | 342 +++++++++--------------------------------- 1 file changed, 67 insertions(+), 275 deletions(-) diff --git a/src/pages/Support.jsx b/src/pages/Support.jsx index 097fc3d..0705393 100644 --- a/src/pages/Support.jsx +++ b/src/pages/Support.jsx @@ -1,13 +1,4 @@ import SEO from '@/components/SEO' -import { useState } from 'react' -import { toast } from 'sonner' -import { Button } from '@/components/ui/Button' -import { Input } from '@/components/ui/Input' -import { Textarea } from '@/components/ui/Textarea' -import { Select } from '@/components/ui/Select' -import RecaptchaPlaceholder from '@/components/RecaptchaPlaceholder' -import { submitSupport } from '@/lib/api' -import { useDebounce } from '@/hooks/useDebounce' import { AlertCircle, ArrowRight, CheckCircle2, Clock3, ExternalLink, Headphones, LifeBuoy, ShieldCheck, TicketCheck, Wrench } from 'lucide-react' const portalLinks = [ @@ -37,114 +28,6 @@ const supportedSystems = [ ] const Support = () => { - const [formState, setFormState] = useState({ - name: '', - company: '', - email: '', - phone: '', - issue: '', - priority: 'medium', - recaptcha_token: '', - company_website: '', // Honeypot field - hidden from humans, bots will fill it - }) - const [errors, setErrors] = useState({ - name: '', - company: '', - email: '', - issue: '', - recaptcha_token: '', - }) - // Debounce validation errors so they don't flash on every keystroke - const debouncedErrors = useDebounce(errors, 300) - const [isSubmitting, setIsSubmitting] = useState(false) - - const validateForm = () => { - const newErrors = { - name: '', - company: '', - email: '', - issue: '', - recaptcha_token: '', - } - - // Validate required fields - if (!formState.name.trim()) newErrors.name = 'Name is required' - if (!formState.company.trim()) newErrors.company = 'Company name is required' - if (!formState.issue.trim()) newErrors.issue = 'Please describe your issue' - - // Validate email format - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ - if (!formState.email.trim()) { - newErrors.email = 'Email is required' - } else if (!emailRegex.test(formState.email)) { - newErrors.email = 'Please enter a valid email address' - } - - // Validate issue minimum length (10 chars matches server-side Zod rule) - if (formState.issue.trim() && formState.issue.trim().length < 10) { - newErrors.issue = 'Issue description must be at least 10 characters' - } - - const hasErrors = Object.values(newErrors).some(error => error !== '') - setErrors(newErrors) - - if (hasErrors) { - toast.error('Please fix the errors in the form') - return false - } - - return true - } - - const handleSubmit = (e) => { - e.preventDefault() - if (!validateForm()) return - handleSubmitForm() - } - - const handleSubmitForm = async () => { - setIsSubmitting(true) - try { - await submitSupport(formState) - toast.success("Thanks! We\'ll get back to you soon.") - setFormState({ - name: '', - company: '', - email: '', - phone: '', - issue: '', - priority: 'medium', - recaptcha_token: '', - company_website: '', - }) - setErrors({ - name: '', - company: '', - email: '', - issue: '', - recaptcha_token: '', - }) - } catch (error) { - if (error.response?.status === 400 && error.fields) { - setErrors(prev => ({ ...prev, ...error.fields })) - toast.error('Please fix the errors in the form') - } else { - toast.error(error.message || 'Failed to submit form. Please try again.') - } - } finally { - setIsSubmitting(false) - } - } - - const handleChange = (e) => { - const { name, value } = e.target - setFormState(prev => ({ ...prev, [name]: value })) - // Clear error for this field as user types - if (errors[name]) { - setErrors(prev => ({ ...prev, [name]: '' })) - } - } - return ( <> { Get help without getting handed off.

- Open a support request, access the client portal, or escalate a service-impacting issue through one clear path. + Sign in to the client portal to manage tickets, create a new support request, or escalate a service-impacting issue through one clear path.

- - Submit Request - + Sign In + + - Open Portal + Create Account
@@ -202,7 +90,7 @@ const Support = () => {

Existing client

-

Submit the form or use the portal to track requests.

+

Sign in to create, update, and track support tickets.

@@ -222,7 +110,7 @@ const Support = () => {

Planned work

-

Use the request form for moves, adds, changes, and deployments.

+

Use the portal for moves, adds, changes, and deployments.

@@ -231,12 +119,11 @@ const Support = () => { - {/* Support Form */} -
+ {/* Support Portal */} +
-
- {/* Left - Info — order 2 on mobile so form appears first */} -
+
+
@@ -245,7 +132,7 @@ const Support = () => {

Support Center

- Sign in to manage existing tickets, create an account, or submit the form on this page for a new request. + Use the client portal to create requests, manage existing tickets, add updates, and keep support history in one place.

@@ -304,160 +191,65 @@ const Support = () => {
- {/* Right - Form — order 1 on mobile so it appears first */} -
-
-
-

Submit a Request

-

- Include who is affected, what changed, and how urgent the issue is. -

-
- -
+
+
+
+ +
- - - {debouncedErrors.name && ( -

{debouncedErrors.name}

- )} -
- -
- - - {debouncedErrors.company && ( -

{debouncedErrors.company}

- )} +

Client Portal

+

Manage support in Zoho Desk.

+

+ Existing clients can sign in to submit new tickets, review open items, and keep communications tied to the right account. +

-
-
- - - {debouncedErrors.email && ( -

{debouncedErrors.email}

- )} -
- -
- - -
-
- -
- - + Sign In +
-
- -