<x-admin.layout :hasExtraSettings="true">
    <div class="nk-block-head nk-block-head-sm">
        <div class="nk-block-between">
            <div class="nk-block-head-content">
                <h3 class="nk-block-title page-title">Smtp Settings</h3>
            </div>
            <div class="nk-block-head-content">
                <ul class="nk-block-tools gx-1">
                    <li class="d-lg-none">
                        <a href="#" class="btn btn-icon btn-trigger toggle" data-target="pageSidebar"><em class="icon ni ni-menu-right"></em></a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="nk-block card card-bordered">
        <div class="card-inner">
            <div class="cart-header mb-3">SMTP Configuration</div>
        </div>
        <form class="form-validate is-alter" id="smtp_fd">
            @csrf
            <div class="row g-gs p-3">
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_name">Smtp Host</label>
                        <div class="form-control-wrap">
                            <input type="text" class="form-control form-control-sm" value="{{ config('settings.mail_host') }}" name="smtp_host" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_email">Smtp Username</label>
                        <div class="form-control-wrap">
                            <input type="email" class="form-control form-control-sm" value="{{ config('settings.mail_username') }}" name="smtp_username" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_phone">Smtp Password</label>
                        <div class="form-control-wrap">
                            <input type="text" class="form-control form-control-sm" value="{{ config('settings.mail_password') }}" name="smtp_password" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_address">Smtp Port</label>
                        <div class="form-control-wrap">
                            <input type="text" class="form-control form-control-sm" value="{{ config('settings.mail_port') }}" name="smtp_port" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_footer">Smtp Encryption Type</label>
                        <div class="form-control-wrap">
                            <input type="text" class="form-control form-control-sm" value="{{ config('settings.mail_encryption') }}" name="smtp_encryption" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_url">From Name</label>
                        <div class="form-control-wrap">
                            <input type="text" class="form-control form-control-sm" value="{{ config('settings.mail_from_name') }}" name="smtp_from_name" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <label class="form-label" for="app_url">From Address</label>
                        <div class="form-control-wrap">
                            <input type="text" class="form-control form-control-sm" value="{{ config('settings.mail_from_address') }}" name="smtp_from_address" required>
                        </div>
                    </div>
                </div>

                <div class="col-md-12">
                    <div class="form-group">
                        <button type="submit" class="btn btn-sm btn-primary">Save</button>
                    </div>
                </div>
            </div>
        </form>
    </div>

    <div class="nk-block card card-bordered">
        <div class="card-inner">
            <div class="cart-header">Test SMTP</div>
        </div>
        <form class="form-validate is-alter" id="tsmtp_fd" method="POST">
            @csrf
            <div class="row g-gs p-3">
                <div class="col-md-6">
                    <div class="form-group">
                        <div class="form-control-wrap">
                            <input type="email" class="form-control form-control-sm" id="to_email"  name="email" placeholder="testemail@mail.com" required>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        <button class="btn btn-primary btn-sm sendMail">
                            <span>Send</span>
                            <span class="spinner-border spinner-border-sm hide sendMail-spinner" style="display: none;" role="status" aria-hidden="true"></span>
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>

</x-admin.layout>
