import type { Dictionary } from "@/i18n/get-dictionary";
import { PageBadge } from "@/components/shared/page-badge";
import { Section } from "@/components/shared/section";
import { ServiceRequestForm } from "./service-request-form";

type ServiceRequestSectionProps = {
  t: Dictionary["serviceRequest"];
  picker: Pick<Dictionary["home"]["contact"]["form"], "selectService" | "services">;
  formText: Dictionary["forms"];
};

/**
 * Request Service page (Figma "service Request", 1440): badge + title, an intro box, and the form card (1000px, centred).
 * Phone & tablet have no Figma frame: the title follows the other page titles (32px) and the text is 12px.
 */
export function ServiceRequestSection({ t, picker, formText }: ServiceRequestSectionProps) {
  return (
    <Section labelledBy="request-title" className="pt-[100px] pb-0 md:pt-[120px] lg:pt-[180px]">
      <div className="flex flex-col gap-10">
        <div className="flex flex-col items-start gap-5">
          <PageBadge>{t.badge}</PageBadge>
          <h1 id="request-title" className="font-heading text-[32px] leading-10 font-bold text-white lg:text-6xl lg:leading-[60px] lg:tracking-[-1.5px]">
            {t.title}
          </h1>
        </div>

        <p className="rounded-2xl border border-white/7 bg-white/10 p-5 text-xs leading-5 font-medium text-soft lg:text-sm lg:leading-6">
          {t.intro}
        </p>

        <div className="mx-auto w-full max-w-[1000px] overflow-hidden rounded-2xl border border-white/7 bg-primary/10">
          <h2 className="border-b border-white/7 p-5 text-xl leading-7 font-semibold text-white">{t.formTitle}</h2>
          <ServiceRequestForm t={t.form} picker={picker} formText={formText} />
        </div>
      </div>
    </Section>
  );
}
