<?php
// Layout prime_cee — design DistributionCEE : en-tête (badge + titre + intro) +
// formulaire d'éligibilité (statique côté composant) + table des primes CEE par
// zone climatique + encart « à retenir » + phrase de transition. Exposé au BO
// (rend le composant bespoke via le registry générique, paramétré par ces champs).

defined('ABSPATH') || exit;

$l = 'prime_cee';

return cvb_layout($l, 'Prime CEE (table par zone)', [
    cvb_clone_entete($l),

    // Table des primes par zone climatique — repeater custom au nom UNIQUE
    // préfixé par le tag du layout (anti-collision WPGraphQL-ACF)
    // → type SectionsSectionsPrimeCeePrimeCeeZones.
    cvb_repeater("field_cvb_{$l}_cee_zones", 'cee_zones', 'Zones climatiques', [
        cvb_field("field_cvb_{$l}_cee_zones_zone", 'zone', 'Zone', 'text', [
            'instructions' => 'Ex. « H1 ».',
        ]),
        cvb_field("field_cvb_{$l}_cee_zones_regions", 'regions', 'Régions', 'text', [
            'instructions' => 'Ex. « Nord et est ».',
        ]),
        cvb_field("field_cvb_{$l}_cee_zones_prime", 'prime', 'Prime', 'text', [
            'instructions' => 'Ex. « ~0,80 à 1,45 €/m² ».',
        ]),
    ], ['max' => 6]),

    cvb_field("field_cvb_{$l}_zones_note", 'zones_note', 'Repère rapide — note', 'textarea', ['rows' => 2]),
    cvb_field("field_cvb_{$l}_retenir_note", 'retenir_note', 'À retenir — note', 'textarea', ['rows' => 3]),
    cvb_field("field_cvb_{$l}_transition", 'transition', 'Phrase de transition', 'textarea', ['rows' => 2]),
    cvb_field("field_cvb_{$l}_cta_label", 'cta_label', 'CTA formulaire — label', 'text', [
        'instructions' => 'Ex. « Envoyer à Covalba ».',
    ]),
]);
