// components/pricing/PlanRecommender.tsx "use client"; import { useMemo, useState } from "react"; import { Plan } from "./types"; export default function PlanRecommender({ plans }: { plans: Plan[] }) { const [sessions, setSessions] = useState(5000); const [risk, setRisk] = useState<"low" | "medium" | "high">("medium"); const [hours, setHours] = useState<"business" | "around" | "always">("around"); const recommended = useMemo(() => { // Simple heuristic: higher sessions + high risk + always-on => mission; else growth; else essential if (sessions >= 20000 || risk === "high" || hours === "always") return "mission"; if (sessions >= 7000 || risk === "medium") return "growth"; return "essential"; }, [sessions, risk, hours]); const plan = plans.find((p) => p.id === recommended)!; return (

Not sure where to start?

Answer three quick questions and we’ll suggest a plan.

setSessions(Number(e.target.value || 0))} min={0} />

Recommended plan

{plan.name} — {plan.bestFor}

You indicated {sessions.toLocaleString()} sessions/mo, {risk} risk tolerance, and{" "} {hours === "always" ? "24/7" : hours === "around" ? "extended" : "business-hours"} support.

{plan.contactOnly ? "Talk to us" : "Start " + plan.name}
); }