<?php
/**
 * Text
 *
 * Text input
 *
 * @since   7.4
 *
 * @package WPrequal
 */

namespace WPrequal;

if ( ! defined( 'ABSPATH' ) ) {
	die( 'Access denied!!' );
}

$is_array = ( 1 === count( $options ) ) ? '' : '[]';
$class = isset( $class ) ? $class : ''; ?>

<div class="wpq-col <?php echo esc_attr( $class ); ?> wpq-checkboxes">

	<fieldset>

		<?php view( 'contact/form', 'legend', $args ); ?>

		<?php foreach ( $options as $option ) { ?>

			<?php $checked  = isset( $option['checked'] ) ? 'checked' : ''; ?>

			<div class="wpq-col-12">

				<input
					type="checkbox"
					name="lead[fields][<?php echo esc_attr( $key ); ?>]<?php echo esc_attr( $is_array ); ?>"
					class="<?php required_class( $required ); ?> checkbox wpq-input"
					value="<?php echo esc_attr( $option['value'] ); ?>"
					<?php echo esc_attr( $checked ); ?>
					aria-label="<?php echo esc_attr( $option['option'] ); ?>"
				/>

				<label><?php echo esc_html( $option['option'] ); ?></label>

			</div>

		<?php } ?>

	</fieldset>

</div>
