<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

// Provides the default set of customer-facing form fields (eg. "Recipient
// Name", "Message"). Each gift-card-form block stores its own field list as
// its formFields attribute (block-scoped, not shared site-wide) - this class
// only supplies the seed default for new blocks, and a fallback for
// rendering contexts that have no block attributes of their own (the
// standalone design-edit screen's "Dynamic Field" list).
class CGC_Form_Fields {

    public static function get_default_fields() {
        return array(
            array( 'key' => 'amount', 'label' => 'Please Select the Donation Amount', 'type' => 'amount', 'options' => array( 18, 35, 50, 100, 200, 300, 400 ), 'allow_other' => true, 'required' => true ),
            array( 'key' => 'recipient_name', 'label' => 'Recipient Name', 'type' => 'text', 'placeholder' => 'Enter the name of the person you would like to honor', 'max_length' => 30, 'required' => true ),
            array( 'key' => 'message', 'label' => 'Message', 'type' => 'textarea', 'placeholder' => 'Enter your message', 'max_length' => 200, 'required' => true ),
            array( 'key' => 'from', 'label' => 'From', 'type' => 'text', 'placeholder' => 'Enter your name', 'max_length' => 30, 'required' => false ),
            array( 'key' => 'emails', 'label' => 'Recipient Email Addresses', 'type' => 'emails', 'required' => true ),
            // Example image-type field so the design editor's image "Dynamic
            // Field" select (object-settings.tsx) has at least one option to
            // offer - this list is also the design editor's only source of
            // available fields (see the class-level comment above).
            array( 'key' => 'photo', 'label' => 'Uploaded Photo', 'type' => 'image', 'required' => false ),
        );
    }
}
