|
| 1 | +import Image from "next/image"; |
| 2 | +import Link from "next/link"; |
| 3 | +import { MailIcon } from "lucide-react"; |
| 4 | + |
| 5 | +import { Button } from "@/components/ui/button"; |
| 6 | +import type { SupportedLanguage } from "@/locales/.generated/types"; |
| 7 | +import { |
| 8 | + oneaiSupportCta, |
| 9 | + oneaiSupportEyebrow, |
| 10 | + oneaiSupportHeading, |
| 11 | + oneaiSupportImageAlt, |
| 12 | + oneaiSupportLede |
| 13 | +} from "@/locales/.generated/strings"; |
| 14 | + |
| 15 | +import { SectionReveal } from "../components/motion-wrappers"; |
| 16 | +import { |
| 17 | + getOneaiSupportPoints, |
| 18 | + ONEAI_SUPPORT_IMAGE_PATH, |
| 19 | + type OneaiSupportPoint |
| 20 | +} from "./get-oneai-support-points"; |
| 21 | + |
| 22 | +type OneaiSupportSectionProps = { |
| 23 | + lang: SupportedLanguage; |
| 24 | + mailtoHref: string; |
| 25 | + /** Support points loader for tests */ |
| 26 | + getPoints?: (options: { lang: SupportedLanguage }) => OneaiSupportPoint[]; |
| 27 | + /** Photo path for tests */ |
| 28 | + imagePath?: string; |
| 29 | +}; |
| 30 | + |
| 31 | +/** |
| 32 | + * Full-bleed support section contrasting local Hyperjump engineers with overseas vendor queues. |
| 33 | + * |
| 34 | + * @param props - Locale, mailto CTA, and optional loaders for DI |
| 35 | + */ |
| 36 | +export function OneaiSupportSection({ |
| 37 | + lang, |
| 38 | + mailtoHref, |
| 39 | + getPoints = getOneaiSupportPoints, |
| 40 | + imagePath = ONEAI_SUPPORT_IMAGE_PATH |
| 41 | +}: OneaiSupportSectionProps) { |
| 42 | + const points = getPoints({ lang }); |
| 43 | + |
| 44 | + return ( |
| 45 | + <section |
| 46 | + id="support" |
| 47 | + data-testid="oneai-support-section" |
| 48 | + className="relative min-h-144 w-full overflow-hidden md:min-h-168"> |
| 49 | + <Image |
| 50 | + src={imagePath} |
| 51 | + alt={oneaiSupportImageAlt(lang)} |
| 52 | + fill |
| 53 | + className="object-cover object-[72%_center]" |
| 54 | + sizes="100vw" |
| 55 | + /> |
| 56 | + <div className="absolute inset-0 bg-linear-to-r from-[#020F15]/94 via-[#020F15]/78 to-[#020F15]/40 md:via-[#020F15]/72 md:to-[#020F15]/22" /> |
| 57 | + |
| 58 | + <div className="relative z-10 mx-auto flex min-h-144 max-w-6xl items-center px-4 py-16 md:min-h-168 md:px-20 xl:px-0"> |
| 59 | + <SectionReveal className="max-w-xl"> |
| 60 | + <p className="mb-4 text-xs font-bold tracking-[0.16em] text-yellow-300 uppercase"> |
| 61 | + {oneaiSupportEyebrow(lang)} |
| 62 | + </p> |
| 63 | + <h2 |
| 64 | + className="mb-5 text-3xl font-semibold tracking-tight text-white md:text-4xl lg:text-[2.75rem] lg:leading-tight" |
| 65 | + data-testid="oneai-support-heading"> |
| 66 | + {oneaiSupportHeading(lang)} |
| 67 | + </h2> |
| 68 | + <p className="mb-8 text-base leading-relaxed text-white/80 md:text-lg"> |
| 69 | + {oneaiSupportLede(lang)} |
| 70 | + </p> |
| 71 | + <ul className="mb-8 space-y-4"> |
| 72 | + {points.map(({ text, title }) => ( |
| 73 | + <li key={title} className="border-l-2 border-yellow-300/70 pl-4"> |
| 74 | + <p className="text-sm font-semibold text-white">{title}</p> |
| 75 | + <p className="mt-1 text-sm leading-relaxed text-white/70"> |
| 76 | + {text} |
| 77 | + </p> |
| 78 | + </li> |
| 79 | + ))} |
| 80 | + </ul> |
| 81 | + <Button |
| 82 | + asChild |
| 83 | + className="bg-hyperjump-blue hover:bg-hyperjump-blue/90 h-12 rounded-full px-8 text-base font-semibold"> |
| 84 | + <Link href={mailtoHref} data-testid="oneai-support-cta"> |
| 85 | + <MailIcon className="mr-2 h-4 w-4" aria-hidden /> |
| 86 | + {oneaiSupportCta(lang)} |
| 87 | + </Link> |
| 88 | + </Button> |
| 89 | + </SectionReveal> |
| 90 | + </div> |
| 91 | + </section> |
| 92 | + ); |
| 93 | +} |
0 commit comments