<?php
defined( 'ABSPATH' ) || exit;

$reasons = [
    "no_longer_needed" => [
        "label" => esc_html__("I do not need this plugin anymore", 'gutendraw')
    ],
    "found_better" => [
        "label" => esc_html__("I found another plugin that do the job better", 'gutendraw'),
        "input" => esc_html__("Please tell us which one", 'gutendraw')
    ],
    "how_to_use" => [
        "label" => esc_html__("I don't know how to use it", 'gutendraw')
    ],
    "temporary" => [
        "label" => esc_html__("This's temporary deactivation", 'gutendraw')
    ],
    "not_working" => [
        "label" => esc_html__("It's not working on my website", 'gutendraw')
    ],
    "other" => [
        "label" => esc_html__("Other", 'gutendraw'),
        "input" => esc_html__("Please share a reason...", 'gutendraw')
    ]
];
?>
<div id="gutendraw-feedback" class="gutendraw-feedback-wrap" style="display:none;">
    <div class="gutendraw-feedback">
        <div class="gutendraw-header">
            <h2 class="gutendraw-title"><?php esc_html_e("Quick Feedback", 'gutendraw'); ?></h2>
            <div class="gutendraw-close"></div>
        </div>
        <div class="gutendraw-data">
            <p class="gutendraw-description"><?php esc_html_e("Before you deactivate GutenDraw could you let us know why? Your feedback will help us improve the product, please tell us why did you decide to deactivate GutenDraw. Thank you!", 'gutendraw'); ?></p>
            <div class="gutendraw-fields">
                <?php foreach($reasons as $key => $value) { ?>
                    <div class="gutendraw-field">
                        <label><input type="radio" name="gutendraw-reason" <?php if ( $key === "temporary" ) echo 'checked'; ?> value="<?php echo esc_attr($key); ?>"><?php echo esc_attr($value["label"]); ?></label>
                        <?php if(isset($value["input"])) { ?>
                            <input type="text" name="reason-<?php echo esc_attr($key); ?>" placeholder="<?php echo esc_attr($value["input"]); ?>">
                        <?php } ?>
                        <?php if(isset($value["text"])) { ?>
                            <p><?php echo esc_html($value["text"]); ?></p>
                        <?php } ?>
                    </div>
                <?php } ?>
            </div>
        </div>
        <div class="gutendraw-footer">
            <div class="gutendraw-btn gutendraw-submit"><?php esc_html_e("Submit & Deactivate", 'gutendraw'); ?></div>
            <div class="gutendraw-btn gutendraw-skip"><?php esc_html_e("Skip & Deactivate", 'gutendraw'); ?></div>
        </div>
    </div>
</div>