<h3 class="sub-settings mt-0">Update Settings</h3>

<div class="mb-3 row">
    <label for="settings[update][license_key]" class="col-sm-3 control-label">License Key</label>
    <div class="col-sm-6">
        <input type="text" class="form-control" id="settings[update][license_key]" name="settings[update][license_key]" placeholder="Enter your ChargePanda license key" value="{{ old('settings.update.license_key', $updateSettings['license_key'] ?? '') }}">
        <small class="form-text text-muted">
            To obtain your license key, visit <a href="https://www.chargepanda.com" target="_blank" rel="noopener">ChargePanda.com</a>, register your account, and generate a license key.
            If you purchased on CodeCanyon, register at ChargePanda.com and link your Envato purchase code to receive your license key.
        </small>
    </div>
</div>

<div class="mb-3 row">
    <label class="col-sm-3 control-label">Last update check</label>
    <div class="col-sm-6">
        @if (!empty($updateSettings['last_checked_at']))
            {{ $updateSettings['last_checked_at'] }}
            @if (array_key_exists('last_check_successful', $updateSettings))
                <span class="badge {{ $updateSettings['last_check_successful'] ? 'bg-success' : 'bg-danger' }} ms-2">{{ $updateSettings['last_check_successful'] ? 'Successful' : 'Failed' }}</span>
            @endif
        @else
            <span class="text-muted">No checks recorded yet.</span>
        @endif
    </div>
</div>

@if (!empty($updateSettings['current_version']))
    <div class="mb-3 row">
        <label class="col-sm-3 control-label">Installed version</label>
        <div class="col-sm-6">
            <span class="font-weight-bold">{{ $updateSettings['current_version'] }}</span>
        </div>
    </div>
@endif

@if (!empty($updateSettings['last_message']))
    <div class="mb-3 row">
        <label class="col-sm-3 control-label">Last response</label>
        <div class="col-sm-6">
            <div class="alert alert-info mb-0">{{ $updateSettings['last_message'] }}</div>
        </div>
    </div>
@endif
