<?php

if ( ! defined('ABSPATH') ) {
    exit;
}

$css_class  = 'sfswp-filter-item sfswp-filter-not-listed sfswp-filter-item-apply-button sfswp-filter-' . $apply_button['value'];
$css_class .= ( isset( $use_apply_button['value'] ) && $use_apply_button['value'] === 'yes' ) ? ' sfswp-opened' : '';
$apply_text      = ( isset( $apply_button_text['value'] ) ) ? $apply_button_text['value'] : esc_html__('Apply', 'searchfiltersort');
$reset_text      = ( isset( $reset_button_text['value'] ) ) ? $reset_button_text['value'] : esc_html__('Reset', 'searchfiltersort');

?>
<div id="sfswp-filter-id-apply-button" class="<?php echo esc_attr( $css_class ); ?>" data-fid="apply-button">
    <div class="sfswp-filter-head">
        <div class="sfswp-filter-title ui-sortable-handle">
            <ul class="sfswp-custom-row sfswp-filter-item-labels">
                <li class="sfswp-filter-order" title="<?php echo $apply_button_order; ?>"><span class="sfswp-filter-sortable-handle dashicons dashicons-menu"></span></li>
                <li class="sfswp-filter-label"><span class="sfswp-button-style sfswp-button-apply"><?php echo $apply_text; ?></span></li>
                <li class="sfswp-filter-label"><span class="sfswp-button-style sfswp-button-reset"><?php echo $reset_text; ?></span></li>
            </ul>
        </div>
    </div>
    <div class="sfswp-filter-body">
        <div class="sfswp-filter-main-fields">
            <table class="sfswp-form-fields-table sfswp-filter-apply-button">
                <tr class="sfswp-filter-tr">
                    <td colspan="2">
                        <?php echo sfs_render_input( $apply_button ); ?>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>