@extends('admin.layouts.app')
@section('panel')
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card b-radius--10">
                <div class="card-body">

                    <form action="{{ route('admin.users.kyc.admin.submit', $user->id) }}" method="post"
                        enctype="multipart/form-data">
                        @csrf

                        <x-viser-form identifier="act" identifierValue="kyc" :existingData="$user->kyc_data" />

                        <div class="contact-form-group">
                            <button type="submit" class="btn btn--success w-100">@lang('Submit')</button>
                        </div>
                    </form>


                    @if ($user->kv == 2)
                        <div class="d-flex flex-wrap justify-content-end mt-3">
                            <button type="button" class="btn btn-outline--danger me-3" data-bs-toggle="modal" data-bs-target="#rejectModal"><i
                                    class="las la-ban"></i>@lang('Reject')</button>
                            <button class="btn btn-outline--success confirmationBtn" data-question="@lang('Are you sure to approve this documents?')"
                                data-action="{{ route('admin.users.kyc.approve', $user->id) }}"><i
                                    class="las la-check"></i>@lang('Approve')</button>
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>

    <x-confirmation-modal />

    <div class="modal fade" id="rejectModal" tabindex="-1" aria-labelledby="rejectModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="rejectModalLabel">@lang('Reject KYC')</h5>
                    <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
                        <i class="las la-times"></i>
                    </button>
                </div>
                <div class="modal-body">
                    <form action="{{ route('admin.users.kyc.reject', $user->id) }}" method="POST">
                        @csrf
                        <div class="form-group">
                            <label>@lang('Reason')</label>
                            <textarea class="form-control" name="kyc_reason" rows="5" required></textarea>
                        </div>
                        <div class="form-group">
                            <button type="submit" class="btn btn--danger w-100">@lang('Submit')</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
@endsection
