@extends($activeTemplate . 'layouts.master')
@section('content')
    @php
        $kycInfo = getContent('kyc_info.content', true);
    @endphp
    <div class="container padding-bottom padding-top">
        <div class="row justify-content-center">
            <div class="col-lg-8">
                @if (auth()->user()->kv == 2)
                    <div class="alert alert-warning" role="alert">
                        <h5 class="alert-heading">@lang('KYC Verification pending')</h5>
                        <hr>
                        <p class="mb-0">{{ __($kycInfo->data_values->pending_content) }} <a
                                href="{{ route('user.kyc.data') }}">@lang('See KYC Data')</a></p>
                    </div>
                @elseif(auth()->user()->kv == 1)
                    <div class="alert alert-success" role="alert">
                        <h5 class="alert-heading">@lang('KYC Verification success')</h5>
                        <hr>
                        <p class="mb-0">
                            {{ __('Welcome to our platform! You can now enjoy all services on our platform. Thank you for completing your KYC verification.') }}
                            <a href="{{ route('user.home') }}">Visit Dashboard</a>
                        </p>
                    </div>
                @elseif(auth()->user()->kv == 0)
                    <div class="alert alert-info" role="alert">
                        <h5 class="alert-heading">@lang('KYC Verification required')</h5>
                        <hr>
                        <p class="mb-0">{{ __($kycInfo->data_values->verification_content) }} </p>
                    </div>
                @elseif(auth()->user()->kv == Status::KYC_REJECTED)
                    <div class="alert alert-danger" role="alert">
                        <h5 class="alert-heading">@lang('KYC Verification rejected')</h5>
                        <hr>
                        <p class="mb-0">@lang('KYC Data is rejected. Please fill out the form again')</p>
                        <h6 class="mb-0 mt-2 text-danger"> <b class="text-dark">@lang('Reason:')</b> <span
                                class="font-weight-bold">{{ auth()->user()->kyc_reason }}</span></h6>
                    </div>
                @endif

                <div class="card custom--card primary-bg profile-wrapper">
                    <form action="{{ route('user.kyc.submit') }}" method="post" enctype="multipart/form-data">
                        @csrf

                        @php
                            $user = auth()->user();
                        @endphp

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

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