// Block `cta_final_simple` — réutilise le composant d'origine CTASection
// (bandeau navy centré, bandeau de preuve, double CTA). Les champs WP non
// remplis retombent sur les défauts du composant (parité pixel préservée) :
// on n'envoie une prop que si elle est non vide.

import CTASection from "@/components/CTASection";
import type { CtaFinalSimpleBlock } from "@/lib/wp/types";

const CtaFinalSimple = (props: CtaFinalSimpleBlock & { position?: number }) => {
  const primaryLabel = props.ctaPrimaire?.label ?? undefined;
  const primaryHref = props.ctaPrimaire?.lien ?? undefined;
  const secondaryLabel = props.ctaSecondaire?.label ?? undefined;
  const secondaryHref = props.ctaSecondaire?.lien ?? undefined;

  return (
    <CTASection
      {...(props.titre ? { title: props.titre } : {})}
      {...(props.sousTitre ? { subtitle: props.sousTitre } : {})}
      {...(props.bandeauPreuve ? { proofBanner: props.bandeauPreuve } : {})}
      {...(primaryLabel ? { primaryLabel } : {})}
      {...(primaryHref ? { primaryHref } : {})}
      {...(secondaryLabel ? { secondaryLabel } : {})}
      {...(secondaryHref ? { secondaryHref } : {})}
    />
  );
};

export default CtaFinalSimple;
