/** Section markup of /global-agriculture, keyed by CMS section key (markup unchanged from the static page). */
import type { PageHeroContent, ProductCatalogContent, TextImageContent } from "@/app/(site)/_lib/pageContent";
import { Columns, PageHero, Paras } from "../blocks";
import { SplitTitle } from "../parts";
import { ProductCatalog } from "@/app/(site)/_components/products/ProductCatalog";
import type { SectionRenderers } from "../render";

export const GLOBAL_AGRICULTURE_SECTIONS: SectionRenderers = {
  "page-hero": (c: PageHeroContent) => <PageHero c={c} wrap parents={[{ label: "Products", href: "/product-services" }]} />,
  introduction: (c: TextImageContent) => (
    <section className="bg-white py-12 md:py-16 lg:py-20">
      <div className="w-full max-w-[1180px] mx-auto px-6">
        <div className="grid grid-cols-1 lg:grid-cols-2 gap-7 lg:gap-12 items-start lg:items-center">
          <Columns
            imagePosition={c.imagePosition}
            image={(side) => (
              <div className="global-agriculture-intro-image" data-reveal={side}>
                <img
                  src={c.image.url}
                  alt={c.image.alt ?? ""}
                  className="w-full aspect-[560/220] h-auto block object-cover"
                  width="560"
                  height="220"
                  loading="lazy"
                />
              </div>
            )}
            text={(side) => (
              <div data-reveal={side}>
                <h2 className="text-[clamp(22px,2.6vw,28px)] font-black leading-tight tracking-[-0.01em]">
                  <SplitTitle title={c.title} hl="text-[#1f63d6]" rest="text-ink" />
                </h2>
                <Paras body={c.body} first="mt-[18px] text-[15px] leading-[1.75] text-[#2E2E2E]" next="mt-4 text-[15px] leading-[1.75] text-[#2E2E2E]" />
              </div>
            )}
          />
        </div>
      </div>
    </section>
  ),
  // The API's products with these labels; the designed catalogue until a product is published.
  catalog: (c: ProductCatalogContent) => <ProductCatalog c={c} />,
};
