+
-
-
-
-
-
-
-
+
+
+
-
-
-
+ {showDeployment && (
+
+
+
+
+ )}
+
+
+
+
-
-
+
+
+
+
);
}
diff --git a/ui/src/components/lead-forms/FormTrustLine.tsx b/ui/src/components/lead-forms/FormTrustLine.tsx
new file mode 100644
index 00000000..6b92c6b8
--- /dev/null
+++ b/ui/src/components/lead-forms/FormTrustLine.tsx
@@ -0,0 +1,10 @@
+// Shared reassurance line shown beneath every lead-form submit. A small,
+// consistent trust signal — keeps the promise identical across all forms.
+
+export function FormTrustLine() {
+ return (
+
+ Average response: under 10 minutes during business hours.
+
+ );
+}
diff --git a/ui/src/components/lead-forms/HireExpertModal.tsx b/ui/src/components/lead-forms/HireExpertModal.tsx
index bceffe12..494ca4fa 100644
--- a/ui/src/components/lead-forms/HireExpertModal.tsx
+++ b/ui/src/components/lead-forms/HireExpertModal.tsx
@@ -1,19 +1,11 @@
"use client";
+import { Sparkles } from "lucide-react";
import { useState } from "react";
import { toast } from "sonner";
-import { Button } from "@/components/ui/button";
-import {
- Dialog,
- DialogContent,
- DialogDescription,
- DialogHeader,
- DialogTitle,
-} from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
-import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import {
Select,
SelectContent,
@@ -22,14 +14,13 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Textarea } from "@/components/ui/textarea";
+import { useAuth } from "@/lib/auth";
-import {
- HIRE_STAGE_OPTIONS,
- HIRE_TIMELINE_OPTIONS,
- HIRE_VOLUME_OPTIONS,
- type LeadSource,
-} from "./leadFieldOptions";
+import { FormTrustLine } from "./FormTrustLine";
+import { HIRE_VOLUME_OPTIONS, type LeadSource } from "./leadFieldOptions";
+import { LeadModalShell } from "./LeadModalShell";
import { MathCaptcha } from "./MathCaptcha";
+import { PhoneField } from "./PhoneField";
import { submitLead } from "./submitLead";
interface HireExpertModalProps {
@@ -40,25 +31,32 @@ interface HireExpertModalProps {
}
export function HireExpertModal({ open, onOpenChange, source, onOpenEnterprise }: HireExpertModalProps) {
+ const { getAccessToken } = useAuth(); // Dograh token for the onboarding service
+ const [name, setName] = useState("");
const [company, setCompany] = useState("");
- const [business, setBusiness] = useState("");
+ const [jobTitle, setJobTitle] = useState("");
const [agentGoal, setAgentGoal] = useState("");
const [phone, setPhone] = useState("");
- const [timeline, setTimeline] = useState("");
const [volume, setVolume] = useState("");
- const [hasScripts, setHasScripts] = useState("");
- const [stage, setStage] = useState("");
const [captchaValid, setCaptchaValid] = useState(false);
const [submitting, setSubmitting] = useState(false);
const reset = () => {
- setCompany(""); setBusiness(""); setAgentGoal(""); setPhone("");
- setTimeline(""); setVolume(""); setHasScripts(""); setStage("");
- setCaptchaValid(false); setSubmitting(false);
+ setName(""); setCompany(""); setJobTitle(""); setAgentGoal("");
+ setPhone(""); setVolume(""); setCaptchaValid(false); setSubmitting(false);
};
+ const canSubmit =
+ Boolean(name.trim()) &&
+ Boolean(company.trim()) &&
+ Boolean(agentGoal.trim()) &&
+ Boolean(phone.trim()) &&
+ Boolean(volume) &&
+ captchaValid &&
+ !submitting;
+
const handleSubmit = async () => {
- if (!company.trim() || !business.trim() || !timeline || !volume || !hasScripts || !stage) {
+ if (!name.trim() || !company.trim() || !agentGoal.trim() || !phone.trim() || !volume) {
toast.error("Please fill in all required fields");
return;
}
@@ -66,10 +64,13 @@ export function HireExpertModal({ open, onOpenChange, source, onOpenEnterprise }
setSubmitting(true);
try {
+ // Resolve the token best-effort; submission still succeeds via PostHog if it fails.
+ const token = await getAccessToken().catch(() => undefined);
await submitLead({
kind: "hire_expert",
source,
- payload: { company, business, agentGoal, phone, timeline, volume, hasScripts, stage },
+ payload: { name, company, jobTitle, agentGoal, phone, volume },
+ token,
});
toast.success("Thanks — we'll reach out about building your agent.");
reset();
@@ -81,115 +82,76 @@ export function HireExpertModal({ open, onOpenChange, source, onOpenEnterprise }
};
return (
-