import Image from "next/image";
import Link from "next/link";
import type { Dictionary } from "@/i18n/get-dictionary";
import { ArrowUpRightIcon } from "@/components/icons";
import { ctaBannerActionClass } from "@/components/shared/cta-banner";
import { PageHeroBackground } from "@/components/shared/page-hero-background";
import { HeroHeadline } from "@/components/shared/hero-headline";

type NoRolesSectionProps = { t: Dictionary["career"]; applyHref: string };

/** Shown instead of the job list when there are no openings (Figma "Career" empty state: 942px, illustration on the end side). */
export function NoRolesSection({ t, applyHref }: NoRolesSectionProps) {
  return (
    <section className="relative isolate flex items-center overflow-hidden pt-[100px] pb-10 lg:min-h-[942px] lg:py-32">
      <PageHeroBackground alt={t.hero.imageAlt} className="h-full" />
      <div className="container-site">
        <div className="flex flex-col items-center gap-10 lg:flex-row lg:justify-between lg:px-20">
          <div className="flex flex-col items-start gap-7">
            <HeroHeadline start={t.empty.titleStart} highlight={t.empty.titleHighlight} />
            <p className="max-w-lg font-heading text-xs leading-5 text-soft lg:text-lg lg:leading-[29.25px]">{t.empty.description}</p>
            <Link href={applyHref} className={ctaBannerActionClass}>
              {t.sendApplication}
              <ArrowUpRightIcon data-icon="inline-end" className="rtl:-scale-x-100" />
            </Link>
          </div>
          <Image src="/images/career/no-open-roles.svg" alt={t.empty.imageAlt} width={519} height={421} className="h-auto w-full max-w-[519px]" />
        </div>
      </div>
    </section>
  );
}
