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

namespace WPrequal;

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

$class = isset( $class ) ? $class : '';?>

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

	<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="radio"
					name="lead[fields][<?php echo esc_attr( $key ); ?>]"
					class="<?php required_class( $required ); ?> radio-button wpq-input"
					value="<?php echo esc_attr( $option['value'] ); ?>"
					<?php echo esc_attr( $checked ); ?>
					aria-label="<?php echo esc_attr( $label ); ?>"
				/>

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

			</div>

		<?php } ?>

	</fieldset>

</div>
